summaryrefslogtreecommitdiff
path: root/wasp
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-31 19:12:38 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-12-31 19:22:54 (GMT)
commitad9714b0dc2f2053d3d31a8cd013d456fefdc93d (patch)
treeaf166d2ae2f69beb637dd036dc41286e64f81472 /wasp
parent1eada36ff4953cb6b52e249c2908e5c74a7917d1 (diff)
manager: Recategorize the theme labels for apps
By default bright and mid are white/grey tones, the ui widgets are blue and the spot colours are different variants of orange. Signed-off-by: Daniel Thompson <daniel@redfelineninja.org.uk>
Diffstat (limited to 'wasp')
-rw-r--r--wasp/apps/chrono.py9
-rw-r--r--wasp/apps/clock.py6
-rw-r--r--wasp/apps/heart.py2
-rw-r--r--wasp/apps/steps.py2
-rw-r--r--wasp/apps/stopwatch.py7
-rw-r--r--wasp/wasp.py20
-rw-r--r--wasp/widgets.py12
7 files changed, 31 insertions, 27 deletions
diff --git a/wasp/apps/chrono.py b/wasp/apps/chrono.py
index a327127..3eae3a1 100644
--- a/wasp/apps/chrono.py
+++ b/wasp/apps/chrono.py
@@ -58,9 +58,8 @@ class ChronoApp():
True then a full redraw is be performed.
"""
draw = wasp.watch.drawable
- hi = wasp.system.theme('accent-hi')
- mid = wasp.system.theme('accent-mid')
- lo = wasp.system.theme('accent-lo')
+ hi = wasp.system.theme('bright')
+ c1 = draw.darken(wasp.system.theme('spot1'), wasp.system.theme('contrast'))
if redraw:
now = wasp.watch.rtc.get_localtime()
@@ -72,7 +71,7 @@ class ChronoApp():
wasp.system.bar.draw()
# Draw the dividers
- draw.set_color(mid)
+ draw.set_color(wasp.system.theme('mid'))
for theta in range(12):
draw.polar(120, 120, theta * 360 // 12, 110, 118, 3)
@@ -98,5 +97,5 @@ class ChronoApp():
hh = (30 * (self._hh % 12)) + (self._mm / 2)
mm = 6 * self._mm
draw.polar(120, 120, hh, 5, 75, 7, hi)
- draw.polar(120, 120, hh, 5, 60, 3, lo)
+ draw.polar(120, 120, hh, 5, 60, 3, draw.darken(c1, 2))
draw.polar(120, 120, mm, 5, 106, 5, hi)
diff --git a/wasp/apps/clock.py b/wasp/apps/clock.py
index f0af15b..9e6ba05 100644
--- a/wasp/apps/clock.py
+++ b/wasp/apps/clock.py
@@ -70,9 +70,9 @@ class ClockApp():
True then a full redraw is be performed.
"""
draw = wasp.watch.drawable
- hi = wasp.system.theme('accent-hi')
- mid = wasp.system.theme('accent-mid')
- lo = wasp.system.theme('accent-lo')
+ hi = wasp.system.theme('bright')
+ lo = wasp.system.theme('mid')
+ mid = draw.lighten(lo, 1)
if redraw:
now = wasp.watch.rtc.get_localtime()
diff --git a/wasp/apps/heart.py b/wasp/apps/heart.py
index bff558e..b465cb4 100644
--- a/wasp/apps/heart.py
+++ b/wasp/apps/heart.py
@@ -45,7 +45,7 @@ class HeartApp():
0, 6, width=240)
# Graph is orange by default...
- color = 0xffc0
+ color = wasp.system.theme('spot1')
# If the maths goes wrong lets show it in the chart!
if spl > 100 or spl < -100:
diff --git a/wasp/apps/steps.py b/wasp/apps/steps.py
index 321a0c1..c7899a6 100644
--- a/wasp/apps/steps.py
+++ b/wasp/apps/steps.py
@@ -102,5 +102,5 @@ class StepCounterApp():
t = str(count)
w = fonts.width(fonts.sans36, t)
draw.set_font(fonts.sans36)
- draw.set_color(0xfff0)
+ draw.set_color(draw.lighten(wasp.system.theme('spot1'), wasp.system.theme('contrast')))
draw.string(t, 228-w, 132-18)
diff --git a/wasp/apps/stopwatch.py b/wasp/apps/stopwatch.py
index 43166a6..0d572af 100644
--- a/wasp/apps/stopwatch.py
+++ b/wasp/apps/stopwatch.py
@@ -88,6 +88,9 @@ class StopwatchApp():
return
y = 240 - 6 - (len(splits) * 24)
+ draw.set_font(fonts.sans24)
+ draw.set_color(wasp.system.theme('mid'))
+
n = self._nsplits
for i, s in enumerate(splits):
centisecs = s
@@ -99,8 +102,6 @@ class StopwatchApp():
t = '# {} {:02}:{:02}.{:02}'.format(n, minutes, secs, centisecs)
n -= 1
- draw.set_font(fonts.sans24)
- draw.set_color(0xe73c)
w = fonts.width(fonts.sans24, t)
draw.string(t, 0, y + (i*24), 240)
@@ -139,7 +140,7 @@ class StopwatchApp():
draw = wasp.watch.drawable
draw.set_font(fonts.sans36)
- draw.set_color(0xc67f)
+ draw.set_color(draw.lighten(wasp.system.theme('ui'), wasp.system.theme('contrast')))
w = fonts.width(fonts.sans36, t1)
draw.string(t1, 180-w, 120-36)
draw.fill(0, 0, 120-36, 180-w, 36)
diff --git a/wasp/wasp.py b/wasp/wasp.py
index 488f92f..de572e5 100644
--- a/wasp/wasp.py
+++ b/wasp/wasp.py
@@ -123,10 +123,12 @@ class Manager():
b'\x7b\xef' # battery
b'\xe7\x3c' # status-clock
b'\x7b\xef' # notify-icon
- b'\xb5\xb6' # accent-mid
- b'\xbd\xb6' # accent-lo
- b'\xff\xff' # accent-hi
- b'\x39\xff' # slider-default
+ b'\xff\xff' # bright
+ b'\xbd\xb6' # mid
+ b'\x39\xff' # ui
+ b'\xff\x00' # spot1
+ b'\xdd\xd0' # spot2
+ b'\x00\x0f' # contrast
)
self.blank_after = 15
@@ -542,10 +544,12 @@ class Manager():
"battery",
"status-clock",
"notify-icon",
- "accent-mid",
- "accent-lo",
- "accent-hi",
- "slider-default")
+ "bright",
+ "mid",
+ "ui",
+ "spot1",
+ "spot2",
+ "contrast")
if theme_part not in theme_parts:
raise IndexError('Theme part {} does not exist'.format(theme_part))
idx = theme_parts.index(theme_part) * 2
diff --git a/wasp/widgets.py b/wasp/widgets.py
index 40523ce..dec213e 100644
--- a/wasp/widgets.py
+++ b/wasp/widgets.py
@@ -235,13 +235,13 @@ class Checkbox():
draw = wasp.watch.drawable
im = self._im
if self.state:
- c1 = wasp.system.theme('slider-default')
- c2 = draw.lighten(c1, 15)
+ c1 = wasp.system.theme('ui')
+ c2 = draw.lighten(c1, wasp.system.theme('contrast'))
fg = c2
else:
c1 = 0
c2 = 0
- fg = wasp.system.theme('accent-lo')
+ fg = wasp.system.theme('mid')
# Draw checkbox on the right margin if there is a label, otherwise
# draw at the natural location
x = 239 - 32 - 4 if im[2] else im[0]
@@ -283,10 +283,10 @@ class Slider():
y = self._y
color = self._color
if self._color is None:
- self._color = wasp.system.theme('slider-default')
+ self._color = wasp.system.theme('ui')
color = self._color
if self._lowlight is None:
- self._lowlight = draw.lighten(color, 15)
+ self._lowlight = draw.lighten(color, wasp.system.theme('contrast'))
light = self._lowlight
knob_x = x + ((_SLIDER_TRACK * self.value) // (self._steps-1))
@@ -344,7 +344,7 @@ class Spinner():
"""Draw the slider."""
draw = watch.drawable
im = self._im
- fg = draw.lighten(wasp.system.theme('slider-default'), 15)
+ fg = draw.lighten(wasp.system.theme('ui'), wasp.system.theme('contrast'))
draw.blit(icons.up_arrow, im[0]+30-8, im[1]+20, fg)
draw.blit(icons.down_arrow, im[0]+30-8, im[1]+120-20-9, fg)
self.update()