From 007912faa9a9247e0df0060d6042069943a1c75b Mon Sep 17 00:00:00 2001 From: Lemmy Date: Sun, 8 Feb 2026 10:35:52 -0500 Subject: [PATCH] template-processor: general_normal_light, clamp lightness to give better results in light mode --- Scripts/python/src/theming/lib/theme.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Scripts/python/src/theming/lib/theme.py b/Scripts/python/src/theming/lib/theme.py index adbc9d29e..871dfc8c5 100644 --- a/Scripts/python/src/theming/lib/theme.py +++ b/Scripts/python/src/theming/lib/theme.py @@ -326,14 +326,15 @@ def generate_normal_light(palette: list[Color]) -> dict[str, str]: error = find_error_color(palette) # Keep colors vibrant - darken for visibility on light bg + # Clamp lightness to [0.25, 0.45] so colors are never near-black nor washed out h, s, l = primary.to_hsl() - primary_adjusted = Color.from_hsl(h, max(s, 0.7), min(l, 0.45)) + primary_adjusted = Color.from_hsl(h, max(s, 0.7), max(min(l, 0.45), 0.25)) h, s, l = secondary.to_hsl() - secondary_adjusted = Color.from_hsl(h, max(s, 0.6), min(l, 0.40)) + secondary_adjusted = Color.from_hsl(h, max(s, 0.6), max(min(l, 0.40), 0.22)) h, s, l = tertiary.to_hsl() - tertiary_adjusted = Color.from_hsl(h, max(s, 0.5), min(l, 0.35)) + tertiary_adjusted = Color.from_hsl(h, max(s, 0.5), max(min(l, 0.35), 0.20)) # Container colors - lighter, less saturated versions of accent colors for light mode def make_container_light(base: Color) -> Color: