update color scheme config & layout
This commit is contained in:
		
							parent
							
								
									0627a480f3
								
							
						
					
					
						commit
						3cc831ba72
					
				@ -6,7 +6,6 @@ refresh_interval: 0.8    # (float) number of seconds in-between progress bar ref
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Set Color Theme
 | 
					# Set Color Theme
 | 
				
			||||||
color_theme:
 | 
					color_theme:
 | 
				
			||||||
  text: [253, 238, 216]          # [R, G, B] All text components
 | 
					  text: [253, 238, 216]          # [R, G, B] All text components and bar outline
 | 
				
			||||||
  bar_outline: [16, 81, 86]      # [R, G, B] Bar in-fill
 | 
					  bar_inside: [30, 215, 96]    # [R, G, B] Bar in-fill
 | 
				
			||||||
  bar_inside: [148, 191, 136]    # [R, G, B] Bar in-fill
 | 
					 | 
				
			||||||
  background: [13, 19, 33]       # [R, G, B] Background
 | 
					  background: [13, 19, 33]       # [R, G, B] Background
 | 
				
			||||||
 | 
				
			|||||||
@ -52,7 +52,6 @@ def display_loop(api: Api, cfg: Dict):
 | 
				
			|||||||
            "Connect to speakers",
 | 
					            "Connect to speakers",
 | 
				
			||||||
            font=Font2,
 | 
					            font=Font2,
 | 
				
			||||||
            fill=(255, 255, 255),
 | 
					            fill=(255, 255, 255),
 | 
				
			||||||
            # fill=cfg["color_theme"]["text"],
 | 
					 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        del spoti_logo, qr, draw
 | 
					        del spoti_logo, qr, draw
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -86,14 +85,12 @@ def display_loop(api: Api, cfg: Dict):
 | 
				
			|||||||
                    f"{current_time.hour}:{current_time.minute:02d}",
 | 
					                    f"{current_time.hour}:{current_time.minute:02d}",
 | 
				
			||||||
                    font=Font3,
 | 
					                    font=Font3,
 | 
				
			||||||
                    fill=(255, 255, 255),
 | 
					                    fill=(255, 255, 255),
 | 
				
			||||||
                    # fill=cfg["color_theme"]["text"],
 | 
					 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                draw.text(
 | 
					                draw.text(
 | 
				
			||||||
                    (20, 152),
 | 
					                    (20, 152),
 | 
				
			||||||
                    current_time.strftime("%a %d"),
 | 
					                    current_time.strftime("%a %d"),
 | 
				
			||||||
                    font=Font2,
 | 
					                    font=Font2,
 | 
				
			||||||
                    fill=(255, 255, 255),
 | 
					                    fill=(255, 255, 255),
 | 
				
			||||||
                    # fill=cfg["color_theme"]["text"],
 | 
					 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                if current_mode != 0:
 | 
					                if current_mode != 0:
 | 
				
			||||||
                    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"])
 | 
					                progress = min(1, progress_time / data["duration_ms"])
 | 
				
			||||||
                bar_width = int((w - 10) * progress)
 | 
					                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(
 | 
					                draw.rectangle(
 | 
				
			||||||
                    [(8, h - 22), (w + 2, h - 8)],
 | 
					                    [(8, h - 22), (w + 2, h - 8)],
 | 
				
			||||||
                    # outline=cfg["color_theme"]["text"],
 | 
					                    outline=cfg["color_theme"]["text"],
 | 
				
			||||||
                    outline=cfg["color_theme"]["bar_outline"],
 | 
					 | 
				
			||||||
                )
 | 
					                )
 | 
				
			||||||
                draw.rectangle(
 | 
					                draw.rectangle(
 | 
				
			||||||
                    [(10, h - 20), (w, h - 10)], fill=cfg["color_theme"]["background"]
 | 
					                    [(10, h - 20), (w, h - 10)], fill=cfg["color_theme"]["background"]
 | 
				
			||||||
 | 
				
			|||||||
@ -19,7 +19,7 @@ class TestApp(unittest.TestCase):
 | 
				
			|||||||
        # Check color_theme structure
 | 
					        # Check color_theme structure
 | 
				
			||||||
        color_theme = self.cfg["color_theme"]
 | 
					        color_theme = self.cfg["color_theme"]
 | 
				
			||||||
        self.assertIsInstance(color_theme, dict)
 | 
					        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.assertIn(key, color_theme)
 | 
				
			||||||
            self.assertIsInstance(color_theme[key], tuple)
 | 
					            self.assertIsInstance(color_theme[key], tuple)
 | 
				
			||||||
            self.assertEqual(len(color_theme[key]), 3)
 | 
					            self.assertEqual(len(color_theme[key]), 3)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user