Ejemplo n.º 1
0
 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())
Ejemplo n.º 2
0
 def luminosity_list(self, rgb):
     h, s, l = color.to_hsl(rgb)
     return [color.from_hsl((h, s, i)) for i in range(101)]
Ejemplo n.º 3
0
 def saturation_list(self, rgb):
     h, s, l = color.to_hsl(rgb)
     return [color.from_hsl((h, i, l)) for i in range(101)]
Ejemplo n.º 4
0
 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))
Ejemplo n.º 5
0
 def get(self) -> str:
     # return the hex color string
     return to_hex(from_hsl((self.h.get(), self.s.get(), self.l.get())))