[minor] Add ThemeProvider.Analysis palette audit tool#44
Open
matt-edmondson wants to merge 1 commit into
Open
Conversation
A console tool that analyzes the ImGui palette each registered theme produces and writes a markdown report. Four checks with fixed WCAG-based gates: text/glyph contrast over every surface they render on, interaction- state distinctness (Oklab lightness), canonical fidelity (accent hue drift and chroma retention vs the source palette), and semantic coverage (meanings defined but unused, or required but missing). Exits non-zero when any theme fails a gate so it doubles as a regression check. Thresholds live in AnalysisThresholds; run with --theme to filter and --strict to fail on warnings too.
|
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
A console tool that analyzes the ImGui palette each registered theme produces (via the real
ImGuiPaletteMapper) and writes a markdown report. It applies fixed, WCAG-based threshold gates and exits non-zero when any theme fails one, so it doubles as a regression check when new themes are added or the mapper changes.Checks
Text/TextDisabled/CheckMarkover every surface they render on. Gates: text 4.5:1 (AA), glyphs 3.0:1 (1.4.11), disabled text a soft invisibility floor.Button/FrameBghover/active states must differ perceptibly in Oklab lightness.Thresholds live in one
AnalysisThresholdsclass. Usage:What it currently reports
Running it over all 38 themes surfaces a systemic imbalance in the mapper (not a tool bug):
Textfails AA over thePrimary-colored surfaces (Button,Header,Tab,TitleBgActive) on every theme, and light-theme checkmarks fall well under 3:1. Hue is preserved perfectly and interaction states are distinct. A follow-up will rebalance the mapper; this tool is the gate that change will be verified against.🤖 Generated with Claude Code