def hsl_changed(self, *args): if self.changing: return h, s, l = self.spin_h.value(), self.spin_s.value(), self.spin_l.value() hsl = QColor() hsl.setHsl(h, s, l) r, g, b = hsl.red(), hsl.green(), hsl.blue() self.changing = True self.spin_r.setValue(r) self.spin_g.setValue(g) self.spin_b.setValue(b) self.changing = False self.rgb_led.set_rgb_value(r, g, b) self.label_color.setStyleSheet('QLabel {{ background: #{:02x}{:02x}{:02x} }}'.format(r, g, b))
def hsl_changed(self, *args): if self.changing: return h, s, l = self.spin_h.value(), self.spin_s.value(), self.spin_l.value() hsl = QColor() hsl.setHsl(h, s, l) r, g, b = hsl.red(), hsl.green(), hsl.blue() self.changing = True self.spin_r.setValue(r) self.spin_g.setValue(g) self.spin_b.setValue(b) self.changing = False self.rgb_led_button.set_color(r, g, b) self.label_color.setStyleSheet( 'QLabel {{ background: #{:02x}{:02x}{:02x} }}'.format(r, g, b))