Keep every coloured text readable in light and dark themes #27

Merged
noah merged 1 commits from dark-mode-contrast into main 2026-11-04 12:52:47 -07:00
Owner

Verified in real system dark and light mode on macOS (M1, system appearance switched and restored), Windows 11 (VM, app-mode setting, app on the desktop) and Linux (Adwaita / Adwaita:dark). Each screenshot was measured with the WCAG contrast formula.

The app's own colours fell short everywhere. Firmware hues were 2.6 to 3.9:1 (LuxOS gold and ePIC blue on light; Alkane, Braiins and Bixbit on dark). Hashrate greens and temperature purples were about 4:1, and the play/pause icons about 2:1 on light buttons.

  • readable()/readable_at(): shift a colour toward black or white, keeping its hue, until it reaches 4.5:1 (text) or 3:1 (icons) on every background it is drawn on.
  • Palette colours are checked against the window, zebra row and KPI card. Palette::text() guards all computed cell colours.
  • Media button icons: at least 3:1 against the button face.
  • macOS self-test snapshot captures the window frame view (wx-rs patch 0011). The apparent white toolbar strip in dark mode was the snapshot leaving the window background transparent, not the real window.

Result: no app-coloured text below 4.5:1 in any of the six combinations. Windows dark went from 6 flagged pairs to only a button outline, and Windows light from 50 to theme chrome and anti-aliasing.

Generated with Claude Code

https://claude.ai/code/session_01BdKQBRg6YCM1XXQCTnD5GF

Verified in real system dark and light mode on macOS (M1, system appearance switched and restored), Windows 11 (VM, app-mode setting, app on the desktop) and Linux (Adwaita / Adwaita:dark). Each screenshot was measured with the WCAG contrast formula. The app's own colours fell short everywhere. Firmware hues were 2.6 to 3.9:1 (LuxOS gold and ePIC blue on light; Alkane, Braiins and Bixbit on dark). Hashrate greens and temperature purples were about 4:1, and the play/pause icons about 2:1 on light buttons. - readable()/readable_at(): shift a colour toward black or white, keeping its hue, until it reaches 4.5:1 (text) or 3:1 (icons) on every background it is drawn on. - Palette colours are checked against the window, zebra row and KPI card. Palette::text() guards all computed cell colours. - Media button icons: at least 3:1 against the button face. - macOS self-test snapshot captures the window frame view (wx-rs patch 0011). The apparent white toolbar strip in dark mode was the snapshot leaving the window background transparent, not the real window. Result: no app-coloured text below 4.5:1 in any of the six combinations. Windows dark went from 6 flagged pairs to only a button outline, and Windows light from 50 to theme chrome and anti-aliasing. Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01BdKQBRg6YCM1XXQCTnD5GF
noah added 1 commit 2026-11-04 12:40:21 -07:00
Keep every coloured text readable in light and dark themes
verify / verify (pull_request) Successful in 7m18s
verify / verify-windows (pull_request) Successful in 4m48s
source / check (pull_request) Skipped
d22ee79159
Checked in real system dark and light mode on macOS (SkyLight theme
switch on the M1, restored afterwards), Windows 11 (the app-mode
setting, run on the VM's desktop) and Linux (Adwaita and Adwaita:dark),
measuring each screenshot's text against its background with the WCAG
contrast formula.

The app's own colours fell short on every platform. The fixed firmware
hues were 2.6 to 3.9:1 (LuxOS gold and ePIC blue on light, Alkane navy,
Braiins purple and Bixbit red on dark). The hashrate greens and
temperature purples were about 4:1, and the play/pause icons about 2:1
on light buttons.

- readable()/readable_at(): nudge a colour toward black (light theme)
  or white (dark theme), keeping its hue, until it reaches 4.5:1 for
  text (3:1 for icons) against every given background.
- palette(): green/amber/red/accent/label are made readable against the
  window, the zebra row and the KPI card; Palette::text() guards every
  computed cell colour (ratio and temperature blends, firmware hues).
- Media button icons: at least 3:1 against the theme's button face.
- macOS snapshot (wx-rs patch 0011): capture the window's frame view.
  The content view alone left unpainted areas transparent, which read
  as a white toolbar strip in dark mode. On screen the area was always
  the dark window colour.

After the change, no app-coloured text is below 4.5:1 in any of the
six theme/platform combinations. What the checker still flags is theme
chrome (grid lines, GTK header labels, button outlines, the zoom
slider) and anti-aliasing on thin fonts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BdKQBRg6YCM1XXQCTnD5GF
noah merged commit de5c1a5a15 into main 2026-11-04 12:52:47 -07:00
noah deleted branch dark-mode-contrast 2026-11-04 12:52:48 -07:00
Sign in to join this conversation.