From 4324d3046e1c62ba2f32a8d4c8bde70e33b359c2 Mon Sep 17 00:00:00 2001 From: Noah <2+noah@noreply.gitea.bluefla.re> Date: Wed, 4 Nov 2026 14:17:52 -0600 Subject: [PATCH] Media icons: 3:1 against the button colour macOS actually paints The play/pause icons on macOS light buttons were about 2.6:1, because native macOS buttons paint #ebebeb on a white window, not the system button-face colour the check used. Check the icons against the button face, the window colour and a shade 20 steps toward the opposite end. They now measure 3.1:1 on the Mac (light and dark checked in real system appearance), and stay above 3:1 on Linux and Windows. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BdKQBRg6YCM1XXQCTnD5GF --- crates/alkane-gui/src/ui.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/alkane-gui/src/ui.rs b/crates/alkane-gui/src/ui.rs index 0d04caac..c1381fbe 100644 --- a/crates/alkane-gui/src/ui.rs +++ b/crates/alkane-gui/src/ui.rs @@ -1091,8 +1091,13 @@ pub fn build(frame: Widget) -> App { // Play / pause / stop as coloured media icons (green / amber / red). Vivid // fixed colours read well on both light and dark themes. // The icon colours are kept to at least 3:1 against this theme's button - // face (the fixed hues alone were about 2:1 on light buttons). - let face = [wx_rs::system_color(3)]; + // face (the fixed hues alone were about 2:1 on light buttons). Native + // buttons do not all paint the system button-face colour (macOS draws + // #ebebeb on a white window), so also check the window colour and a shade + // 20 steps toward the opposite end. + let win = wx_rs::system_color(0); + let shade = if luminance(win) < 128.0 { 20 } else { -20 }; + let face = [wx_rs::system_color(3), win, nudge(win, shade)]; let icon = |c| readable_at(c, &face, MIN_ICON_CONTRAST); let play_btn = Widget::media_button(panel, ID_PLAY, 0, icon((56, 190, 108))); ctl.add(play_btn, 0, sf::ALIGN_CENTRE_VERTICAL | sf::BORDER_ALL, 2); -- 2.54.0