Repository navigation
Conversation
The helper printed whichever of the theme text and theme background had the higher contrast against the bar strip's average, with no floor. A dark theme's background is a charcoal surface rather than ink, so the theme colors can both fall under the 4.5:1 WCAG AA floor for small text. On Liftoff's blue sky (#3f87b8) the bar came out #151E26 at 4.31:1, close enough in hue to the sky that it reads as a soft edge, while the cream foreground was 3.12:1. When neither theme color clears the floor, use the plain ink that is legible on the sample instead.
[Medium impact] The PR appears safe to merge. SummaryAdds a contrast floor to
anandude explicitly acknowledges that one bar-wide color cannot guarantee contrast across every wallpaper region and defers per-region colors. No actionable issues found. Tests were inspected but not run. Reviews (1) · Last reviewed commit: "Keep the transparent bar's text legible ..." · Reviewed by Greptile |
|
Reviewed far enough to classify, and the classification is unsettled, so nothing has been tested yet and no labels have gone on. Two models classified this pull request separately. Claude Opus 5.5 called it a bug fix: on a shipped theme and wallpaper (Liftoff's Not a duplicate: #8615 goes after the same issue with per-region colours and is a broader change, and #14281 and #14220 only touch the sampling above the colour choice. Next step is the maintainer's: they decide whether a black or white fallback is behaviour they want in the transparent bar, and that settles the classification. Until then, nothing else happens on this pull request. |
Fixes #14732
Problem
With a transparent bar,
bin/omarchy-bar-text-colorsamples the wallpaper strip under the bar and prints whichever of the theme text color and the theme background color has the higher contrast against that average. There is no floor.Both candidates are surface colors a theme picked for a solid bar, so on a bright wallpaper the better of them can still be under the 4.5:1 WCAG AA floor for small text. On Liftoff's blue sky (
#3f87b8) the helper returns#151E26at 4.31:1 while the cream foreground is 3.12:1 — and the charcoal is close enough in hue to the sky that the shortfall reads as a soft edge. Against the sky directly behind the clock (#1d73ac) it is 3.29:1.Change
When neither theme color clears 4.5:1 against the sample, print the plain ink that is legible there instead — black or white, whichever has the higher contrast. The two theme colors still compete exactly as before whenever either of them clears the floor, so this only changes the outcome on wallpapers where both fail:
#151E26#ECE5D8#000000#097bba#1d73ac#7ba4c2One global color still cannot clear 4.5:1 on a backdrop that runs from a saturated sky to a pale cloud: the clock sky tops out at 4.10:1 for any single ink. Per-region ink, as #8615 proposes, is the follow-up that would clear it; this change takes the floor as far as a single bar-wide color can.
There is no layout or styling change — the helper's output contract (one color) and
Bar.qmlare untouched.Tests
test/shell.d/bar-text-color-test.shgains two cases: a saturated mid-blue strip where both theme colors miss the floor and the fallback is black (5.37:1 over 4.31:1), and a mid-grey strip where the fallback is white (5.33:1 over 4.25:1).The shell suite's other failures on this machine reproduce on clean
quattroin a live session (the ones I checked —background-instant-reload-test,default-apps-test,i18n-test,battery-status-test— fail with these changes stashed), so they are the environment, not this change../test/clipasses (125 checks).bin/omarchy-bar-text-coloris also touched by #14281 and #14220, both in the sampling block above the color choice, so the second of those to land needs a trivial rebase here.