def update_panel(self, *_): hsl = self.hue.get_hsl()[0], self.sat.get_hsl()[1], self.lum.get_hsl( )[2] hex_string = color.to_hex(color.from_hsl(hsl)) # We have set panel value implicitly so we update the hex value ourselves self.monitor.set(hex_string, True) self.monitor.hex_string.set(hex_string) if self._on_change: self._on_change(self.monitor.get())
def luminosity_list(self, rgb): h, s, l = color.to_hsl(rgb) return [color.from_hsl((h, s, i)) for i in range(101)]
def saturation_list(self, rgb): h, s, l = color.to_hsl(rgb) return [color.from_hsl((h, i, l)) for i in range(101)]
def get(self) -> str: # return the hex color string hsl = self.h.get(), self.s.get(), self.l.get() if any(i == "" for i in hsl): return self.initial return to_hex(from_hsl(hsl))
def get(self) -> str: # return the hex color string return to_hex(from_hsl((self.h.get(), self.s.get(), self.l.get())))