def new_undy_edit(self): qcolor = QColorDialog().getColor(QColor(*self.colors["undy"]), self.dialog) if qcolor.isValid(): new = qcolor.getRgb() self.colors["undy"] = [new[0], new[1], new[2]] self.write_appearance_values()
def choose_new_indirect_colour(self): new_colour = QColorDialog().getColor( initial=self.indirect_match_colour, parent=self) if new_colour.isValid(): r, g, b, _ = new_colour.getRgb() self.indirect_match_colour = new_colour self.ui.labelIndirectMatchedRow.setStyleSheet( 'QLabel {{ background-color : rgb({},{},{})}}'.format(r, g, b))
def _handle_color_pick(self): # Color picker will popup and returns chosen color color = QColorDialog().getColor(QColor(*self.canvas.color)) if color.isValid(): self._ui.colorButton.setStyleSheet( f'background-color: {color.name()}') r, g, b, alpha = color.getRgb() self.canvas.set_color((r, g, b))