Skip to content

Map every ImGuiCol slot in ImGuiPaletteMapper - #122

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/110-map-every-imguicol
Sep 30, 2026
Merged

matt-edmondson merged 1 commit into
mainfrom
fix/110-map-every-imguicol

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #110

Before: ImGuiPaletteMapper.MapTheme left 13 ImGuiCol slots unmapped, so they kept the previous style's values. Light themes applied over StyleColorsDark() had a white text cursor on light input frames and dark navy tabs in unfocused windows.

After: every slot below ImGuiCol.Count is mapped, as the issue suggests:

Slot Mapping
InputTextCursor Neutral / VeryHigh, the same as Text
TextLink, NavCursor, DragDropTarget, DockingPreview, TabSelectedOverline, TabDimmedSelectedOverline Primary / High
TabDimmed Neutral / VeryLow
TabDimmedSelected Neutral / Low
TreeLines Neutral / MediumHigh, the same as Separator
DockingEmptyBg Neutral / VeryLow, the same as WindowBg
NavWindowingDimBg, ModalWindowDimBg Neutral / Medium, with alpha 0.20 and 0.35 (ImGui's stock values)

The alpha comes from a small alphaOverrides table applied during the conversion to Vector4. Every other slot stays opaque.

Tests (ImGuiPaletteMapperTests):

  • MapTheme_AssignsEveryImGuiColor checks that every ImGuiCol below Count is present for every theme. The existing size-equality test can't catch a slot that every theme is missing.
  • MapTheme_InputTextCursorMatchesText
  • MapTheme_DimBackgroundsAreTranslucent

All three fail on main (first failure: Catppuccin Latte: missing ImGui color InputTextCursor) and pass with the change. The full ThemeProvider.Test suite passes locally on net10.0 in Release.

🤖 Generated with Claude Code

https://claude.ai/code/session_015ErXBgrjdbMZYoULNa1H7n


Generated by Claude Code

Thirteen ImGuiCol slots had no mapping, so applying a theme left them at
the previous style's values. Light themes kept StyleColorsDark's white
text cursor and navy dimmed tabs. The slots are now mapped from the
semantic palette, and the two dimming overlays get translucent alpha.

A new test asserts that every ImGuiCol below Count is assigned for every
theme, which comparing themes against each other could not catch.

Fixes #110

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ErXBgrjdbMZYoULNa1H7n
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit b701116 into main Sep 30, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/110-map-every-imguicol branch September 30, 2026 08:34
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.

ImGuiPaletteMapper leaves 13 ImGuiCol slots unmapped, so light themes keep dark defaults (white text cursor, navy dimmed tabs)

2 participants