From 132e133b1d7f8d4d7d3407ab76ff71107bb73fe9 Mon Sep 17 00:00:00 2001 From: Honey Date: Thu, 23 Jul 2026 11:56:24 +0200 Subject: [PATCH] All screens: drop gray text, matching the Journey fix The epd4in0e panel's palette has no gray at all (just black/white/ yellow/red/blue/green -- see epd4in0e.py's putpalette), so any gray RGB fill gets Floyd-Steinberg dithered into a black/white checkerboard across the whole glyph body. At the small font sizes most of these screens use (Navidrome's artist/album/genre/source lines, Departures' direction/platform columns, Weather's description/forecast labels, Clock's date line, the placeholder messages), that reads as blurry, half-rendered text -- same root cause already fixed in Journey. Switched every gray fill/outline to solid black across navidrome.py, weather.py, departures.py, clock.py, and picture.py. Left the intentionally-faint row-divider hairlines (228,228,228) alone -- those are meant to almost disappear, not readable text. Removed departures.py's now-unused MUTED constant. --- screens/clock.py | 2 +- screens/departures.py | 7 +++---- screens/navidrome.py | 22 +++++++++++----------- screens/picture.py | 2 +- screens/weather.py | 8 ++++---- 5 files changed, 20 insertions(+), 21 deletions(-) diff --git a/screens/clock.py b/screens/clock.py index dfb7f1a..8972c60 100644 --- a/screens/clock.py +++ b/screens/clock.py @@ -50,6 +50,6 @@ class ClockScreen(Screen): draw.text(((width - tw) / 2, block_top - time_top), time_str, font=time_font, fill="black") dw = date_right - date_left - draw.text(((width - dw) / 2, block_top + time_h + gap - date_top), date_str, font=date_font, fill=(90, 90, 90)) + draw.text(((width - dw) / 2, block_top + time_h + gap - date_top), date_str, font=date_font, fill="black") return image diff --git a/screens/departures.py b/screens/departures.py index 78da91e..8482666 100644 --- a/screens/departures.py +++ b/screens/departures.py @@ -30,7 +30,6 @@ RESULTS_CHOICES = (3, 5, 8) BLACK = (0, 0, 0) RED = (200, 0, 0) -MUTED = (110, 110, 110) FAINT_LINE = (228, 228, 228) @@ -167,7 +166,7 @@ class DeparturesScreen(Screen): self._draw_centered_v(draw, line_text, line_font, pad, row_cy, BLACK) direction = truncate_to_width(draw, dep["direction"], dir_font, dir_w - 10) - self._draw_centered_v(draw, direction, dir_font, dir_x, row_cy, (60, 60, 60)) + self._draw_centered_v(draw, direction, dir_font, dir_x, row_cy, BLACK) if dep["cancelled"]: time_text, time_color = "Fällt aus", RED @@ -184,7 +183,7 @@ class DeparturesScreen(Screen): pw = text_width(draw, platform_text, platform_font) self._draw_centered_v( draw, platform_text, platform_font, - platform_x + (platform_w - pw) / 2, row_cy, MUTED, + platform_x + (platform_w - pw) / 2, row_cy, BLACK, ) return image @@ -192,7 +191,7 @@ class DeparturesScreen(Screen): def _render_message(self, draw, width, height, scale, msg): font = load_font(size=int(scale * 0.06)) mw = text_width(draw, msg, font) - draw.text(((width - mw) / 2, height / 2), msg, font=font, fill=MUTED) + draw.text(((width - mw) / 2, height / 2), msg, font=font, fill=BLACK) def _draw_centered_v(self, draw, text, font, x, cy, fill): left, top, right, bottom = draw.textbbox((0, 0), text, font=font) diff --git a/screens/navidrome.py b/screens/navidrome.py index 4ec138e..feded5b 100644 --- a/screens/navidrome.py +++ b/screens/navidrome.py @@ -186,7 +186,7 @@ class NavidromeScreen(Screen): font = load_font(size=int(min(width, height) * 0.06)) msg = "Nichts läuft gerade" mw = text_width(draw, msg, font) - draw.text(((width - mw) / 2, height / 2), msg, font=font, fill=(140, 140, 140)) + draw.text(((width - mw) / 2, height / 2), msg, font=font, fill="black") def _render_landscape(self, image, draw, track, cover, settings, idle, width, height): pad = int(width * 0.025) @@ -223,11 +223,11 @@ class NavidromeScreen(Screen): image.paste(fitted, (x, y)) else: draw = ImageDraw.Draw(image) - draw.rectangle((x, y, x + size, y + size), outline=(60, 60, 60), width=2) + draw.rectangle((x, y, x + size, y + size), outline="black", width=2) font = load_font(size=int(size * 0.3)) note = "♪" nw = text_width(draw, note, font) - draw.text((x + (size - nw) / 2, y + size * 0.35), note, font=font, fill=(150, 150, 150)) + draw.text((x + (size - nw) / 2, y + size * 0.35), note, font=font, fill="black") def _draw_meta(self, draw, track, settings, idle, x, y, w, h, scale, center=False): status_font = load_font(size=int(scale * 0.038), bold=True) @@ -256,7 +256,7 @@ class NavidromeScreen(Screen): status = "ZULETZT GESPIELT" if idle else "● NOW PLAYING" def draw_status(yy): - draw.text((centered_x(status, status_font), yy), status, font=status_font, fill=(100, 100, 100)) + draw.text((centered_x(status, status_font), yy), status, font=status_font, fill="black") items.append((status_font.size * 1.8, draw_status)) @@ -271,7 +271,7 @@ class NavidromeScreen(Screen): artist_line = truncate_to_width(draw, track["artist"], artist_font, w) def draw_artist(yy): - draw.text((centered_x(artist_line, artist_font), yy), artist_line, font=artist_font, fill=(30, 30, 30)) + draw.text((centered_x(artist_line, artist_font), yy), artist_line, font=artist_font, fill="black") items.append((artist_font.size * 1.4, draw_artist)) @@ -282,7 +282,7 @@ class NavidromeScreen(Screen): album_line = truncate_to_width(draw, album_line, album_font, w) def draw_album(yy, album_line=album_line): - draw.text((centered_x(album_line, album_font), yy), album_line, font=album_font, fill=(110, 110, 110)) + draw.text((centered_x(album_line, album_font), yy), album_line, font=album_font, fill="black") items.append((album_font.size * 1.4, draw_album)) @@ -290,7 +290,7 @@ class NavidromeScreen(Screen): genre_line = truncate_to_width(draw, track["genre"].upper(), album_font, w) def draw_genre(yy, genre_line=genre_line): - draw.text((centered_x(genre_line, album_font), yy), genre_line, font=album_font, fill=(150, 150, 150)) + draw.text((centered_x(genre_line, album_font), yy), genre_line, font=album_font, fill="black") items.append((album_font.size * 1.4, draw_genre)) @@ -305,15 +305,15 @@ class NavidromeScreen(Screen): def draw_progress(yy, bar_h=bar_h, bar_gap=bar_gap): bar_y = yy + bar_gap - draw.rectangle((x, bar_y, x + w, bar_y + bar_h), outline=(180, 180, 180)) - draw.text((centered_x(track["duration_text"], source_font), bar_y + bar_h + status_font.size * 0.4), track["duration_text"], font=source_font, fill=(110, 110, 110)) + draw.rectangle((x, bar_y, x + w, bar_y + bar_h), outline="black") + draw.text((centered_x(track["duration_text"], source_font), bar_y + bar_h + status_font.size * 0.4), track["duration_text"], font=source_font, fill="black") items.append((bar_gap + bar_h + status_font.size * 0.4 + source_font.size * 1.6, draw_progress)) elif track["duration"]: duration_badge = track["duration_text"] def draw_duration(yy, duration_badge=duration_badge): - draw.text((centered_x(duration_badge, source_font), yy), duration_badge, font=source_font, fill=(110, 110, 110)) + draw.text((centered_x(duration_badge, source_font), yy), duration_badge, font=source_font, fill="black") items.append((source_font.size * 1.6, draw_duration)) @@ -335,7 +335,7 @@ class NavidromeScreen(Screen): # overlap whatever the block above drew -- long titles/metadata # can still push past where a fixed bottom position would land. bottom_y = max(cursor + status_font.size * 0.4, y + h - source_font.size * 1.3) - draw.text((centered_x(source_line, source_font), bottom_y), source_line, font=source_font, fill=(140, 140, 140)) + draw.text((centered_x(source_line, source_font), bottom_y), source_line, font=source_font, fill="black") def _cover_fit(image: Image.Image, size: int) -> Image.Image: diff --git a/screens/picture.py b/screens/picture.py index 153ee4a..17826a4 100644 --- a/screens/picture.py +++ b/screens/picture.py @@ -70,7 +70,7 @@ class PictureScreen(Screen): font = load_font(size=int(min(width, height) * 0.06)) msg = "Kein Bild konfiguriert" mw = text_width(draw, msg, font) - draw.text(((width - mw) / 2, height / 2), msg, font=font, fill=(140, 140, 140)) + draw.text(((width - mw) / 2, height / 2), msg, font=font, fill="black") return image if settings.get("fit", "cover") == "contain": diff --git a/screens/weather.py b/screens/weather.py index 743070b..ab7a054 100644 --- a/screens/weather.py +++ b/screens/weather.py @@ -129,7 +129,7 @@ class WeatherScreen(Screen): settings.get("latitude") and settings.get("longitude") ) else "Wetterdaten nicht verfügbar" mw = text_width(draw, msg, font) - draw.text(((width - mw) / 2, height / 2), msg, font=font, fill=(120, 120, 120)) + draw.text(((width - mw) / 2, height / 2), msg, font=font, fill="black") return image days = state.get("days") or [] @@ -174,7 +174,7 @@ class WeatherScreen(Screen): desc_y = temp_y + temp_h + temp_gap dw = desc_right - desc_left - draw.text(((width - dw) / 2, desc_y - desc_top), desc, font=desc_font, fill=(90, 90, 90)) + draw.text(((width - dw) / 2, desc_y - desc_top), desc, font=desc_font, fill="black") if has_forecast: forecast_y = current_h @@ -192,7 +192,7 @@ class WeatherScreen(Screen): label = day["label"] lw = text_width(draw, label, label_font) - draw.text((cx - lw / 2, y), label, font=label_font, fill=(60, 60, 60)) + draw.text((cx - lw / 2, y), label, font=label_font, fill="black") y += label_font.size * 1.4 draw_weather_icon(draw, day["kind"], cx, y + day_icon_size / 2, day_icon_size) @@ -200,6 +200,6 @@ class WeatherScreen(Screen): temps = f"{round(day['high'])}°/{round(day['low'])}°" dtw = text_width(draw, temps, day_temp_font) - draw.text((cx - dtw / 2, y), temps, font=day_temp_font, fill=(50, 50, 50)) + draw.text((cx - dtw / 2, y), temps, font=day_temp_font, fill="black") return image