Skip to content

[minor] Add ThemeProvider.Analysis palette audit tool#44

Open
matt-edmondson wants to merge 1 commit into
mainfrom
feat/theme-analysis-tool
Open

[minor] Add ThemeProvider.Analysis palette audit tool#44
matt-edmondson wants to merge 1 commit into
mainfrom
feat/theme-analysis-tool

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

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

  • WCAG contrastText/TextDisabled/CheckMark over every surface they render on. Gates: text 4.5:1 (AA), glyphs 3.0:1 (1.4.11), disabled text a soft invisibility floor.
  • Interaction distinctnessButton/FrameBg hover/active states must differ perceptibly in Oklab lightness.
  • Canonical fidelity — accent hue drift and chroma retention vs the theme's source palette (does it still look like Nord/Dracula).
  • Semantic coverage — meanings a theme defines but the mapper never uses, or needs but the theme lacks.

Thresholds live in one AnalysisThresholds class. Usage:

dotnet run --project ThemeProvider.Analysis -- [--output <path>] [--theme <name>] [--strict]

What it currently reports

Running it over all 38 themes surfaces a systemic imbalance in the mapper (not a tool bug): Text fails AA over the Primary-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

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.
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant