summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-29 12:31:38 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-29 12:31:38 (GMT)
commitf8231bc0aca46660b3ff000766fb8b22c26bae97 (patch)
tree1c7d15ae15f3e3dc63eaa8462d2be3b6771c1fbe
parentff76abfb8b9d2fe2fe19d353dee8df77c420344e (diff)
widgets: Slider: Adopt draw565.lighten for palette management
Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
-rw-r--r--wasp/widgets.py10
1 files changed, 1 insertions, 9 deletions
diff --git a/wasp/widgets.py b/wasp/widgets.py
index d1cf1fd..4f139fc 100644
--- a/wasp/widgets.py
+++ b/wasp/widgets.py
@@ -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))