From 3cc831ba720853c0f3f0334258248a877a688358 Mon Sep 17 00:00:00 2001 From: barry Date: Sat, 11 Jan 2025 19:08:52 +0100 Subject: [PATCH] update color scheme config & layout --- spotiplayer_pi/config.yaml | 5 ++--- spotiplayer_pi/main.py | 11 +---------- tests/test_app.py | 2 +- 3 files changed, 4 insertions(+), 14 deletions(-) diff --git a/spotiplayer_pi/config.yaml b/spotiplayer_pi/config.yaml index d31bfbd..0146639 100644 --- a/spotiplayer_pi/config.yaml +++ b/spotiplayer_pi/config.yaml @@ -6,7 +6,6 @@ refresh_interval: 0.8 # (float) number of seconds in-between progress bar ref # Set Color Theme color_theme: - text: [253, 238, 216] # [R, G, B] All text components - bar_outline: [16, 81, 86] # [R, G, B] Bar in-fill - bar_inside: [148, 191, 136] # [R, G, B] Bar in-fill + text: [253, 238, 216] # [R, G, B] All text components and bar outline + bar_inside: [30, 215, 96] # [R, G, B] Bar in-fill background: [13, 19, 33] # [R, G, B] Background diff --git a/spotiplayer_pi/main.py b/spotiplayer_pi/main.py index 7de28ba..958cdeb 100644 --- a/spotiplayer_pi/main.py +++ b/spotiplayer_pi/main.py @@ -52,7 +52,6 @@ def display_loop(api: Api, cfg: Dict): "Connect to speakers", font=Font2, fill=(255, 255, 255), - # fill=cfg["color_theme"]["text"], ) del spoti_logo, qr, draw @@ -86,14 +85,12 @@ def display_loop(api: Api, cfg: Dict): f"{current_time.hour}:{current_time.minute:02d}", font=Font3, fill=(255, 255, 255), - # fill=cfg["color_theme"]["text"], ) draw.text( (20, 152), current_time.strftime("%a %d"), font=Font2, fill=(255, 255, 255), - # fill=cfg["color_theme"]["text"], ) if current_mode != 0: current_mode = 0 @@ -144,15 +141,9 @@ def display_loop(api: Api, cfg: Dict): ) progress = min(1, progress_time / data["duration_ms"]) bar_width = int((w - 10) * progress) - draw.rectangle( - [(7, h - 23), (w + 3, h - 7)], - # outline=cfg["color_theme"]["text"], - outline=cfg["color_theme"]["bar_outline"], - ) draw.rectangle( [(8, h - 22), (w + 2, h - 8)], - # outline=cfg["color_theme"]["text"], - outline=cfg["color_theme"]["bar_outline"], + outline=cfg["color_theme"]["text"], ) draw.rectangle( [(10, h - 20), (w, h - 10)], fill=cfg["color_theme"]["background"] diff --git a/tests/test_app.py b/tests/test_app.py index 974841e..a38068b 100644 --- a/tests/test_app.py +++ b/tests/test_app.py @@ -19,7 +19,7 @@ class TestApp(unittest.TestCase): # Check color_theme structure color_theme = self.cfg["color_theme"] self.assertIsInstance(color_theme, dict) - for key in ["text", "bar_outline", "bar_inside", "background"]: + for key in ["text", "bar_inside", "background"]: self.assertIn(key, color_theme) self.assertIsInstance(color_theme[key], tuple) self.assertEqual(len(color_theme[key]), 3)