1
0
Fork 0

widgets: Slider: Adopt draw565.lighten for palette management

Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
This commit is contained in:
Daniel Thompson 2020-12-29 12:31:38 +00:00
parent ff76abfb8b
commit f8231bc0ac

View file

@ -244,15 +244,7 @@ class Slider():
self._color = wasp.system.theme('slider-default')
color = self._color
if self._lowlight is None:
# Automatically generate a lowlight color
if color < 0b10110_000000_00000:
color = (color | 0b10110_000000_00000) & 0b10110_111111_11111
if (color & 0b111111_00000) < 0b101100_00000:
color = (color | 0b101100_00000) & 0b11111_101100_11111
if (color & 0b11111) < 0b10110:
color = (color | 0b11000) & 0b11111_111111_10110
self._lowlight = color
color = self._color
self._lowlight = draw.lighten(color, 15)
light = self._lowlight
knob_x = x + ((_SLIDER_TRACK * self.value) // (self._steps-1))