[minor] Rebalance semantic palette for text/glyph contrast#47
Open
matt-edmondson wants to merge 1 commit into
Open
[minor] Rebalance semantic palette for text/glyph contrast#47matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
The ImGui mapper placed accent fills (Button/Header/Tab/TitleBg) at mid-high lightness while body text uses the brightest neutral, so text-on-accent contrast failed WCAG AA on every theme, and light-theme checkmarks fell under 3:1. - Mapper: move text-bearing surfaces toward the low (background) lightness end so they sit far from the text color in both light and dark themes; base backgrounds (Child/Popup/MenuBar) share the window surface; the checkmark glyph takes the most-visible accent to contrast its frame. - SemanticColorMapper: widen the non-neutral band to 20-82% of the global range. The lower floor gives accent surfaces contrast room and lets glyphs reach a dark enough value; capping the top below the global maximum keeps saturated hues in gamut instead of washing out near white. Measured across the 38 registered themes with ThemeProvider.Analysis: text/glyph contrast passes on 33 (was 0); hue is preserved exactly. The 4 remaining are intentionally low-contrast light themes whose source palettes cannot reach AA without losing their character.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The palette audit tool (#44) showed a systemic imbalance:
Textfailed WCAG AA over everyPrimary-colored surface on all 38 themes, and light-theme checkmarks fell under 3:1. Root cause was structural, not per-theme: accent fills sat at mid-high lightness while body text uses the brightest neutral, so light text landed on a light-ish fill.Changes
ImGuiPaletteMapper— move text-bearing surfaces (Button,Header,Tab,TitleBgActive,TableHeaderBg,FrameBg) toward the low (background) lightness end. BecauseTextalways sits at the maximum-visibility end, this widens the text/surface lightness gap in both light and dark themes. Base backgrounds (ChildBg/PopupBg/MenuBarBg) share the window surface; theCheckMarkglyph takes the most-visible accent so it contrasts its frame.SemanticColorMapper— widen the non-neutral band from 50–90% to 20–82% of the global lightness range. The lower floor gives accent surfaces contrast room and lets glyphs reach a dark enough value; capping the top below the global maximum keeps saturated hues in gamut instead of washing out near white (this also fixed the pre-existing chroma warnings on Dracula/One Dark/Nightfly).Result (measured by
ThemeProvider.Analysis)Hue is preserved exactly (0° drift) on every theme. The 4 remaining fails (Tokyo Night Day, Everforest Light/Hard/Soft) are intentionally low-contrast light themes whose source palettes span too little lightness to reach AA on mid-surfaces without losing their character, so they stay flagged rather than distorted. Existing tests pass.
🤖 Generated with Claude Code