feat(theme): darker text + buttons in light themes (revert modal backing)

Replace the light-theme modal backing (19e3138, now reverted) with a root-cause
fix: darken the light themes' UI elements for contrast.
- Buttons: the light-theme ImGuiCol_Button overlays were barely-there grey
  (5/8/12% black); bump to 13/20/28% so buttons read as buttons on light
  surfaces (one edit in ApplyColorThemeToImGui covers all light skins).
- Text: raise --on-surface-medium (60-72% -> 86%) and --on-surface-disabled
  (38-40% -> 52%) across the light skins (light, color-pop-light, dune, marble,
  iridescent) — the dominant secondary/label text was too faint. Base
  --on-surface was already near-black, left as-is.
The active theme is TOML-skin-driven, so the code GetMaterialLightTheme() is not
the live source; edits are in the skin TOMLs + the ImGui-style mapping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-04 16:57:38 -05:00
parent 19e31388d9
commit bb2337b552
7 changed files with 14 additions and 29 deletions

View File

@@ -418,9 +418,10 @@ void ApplyColorThemeToImGui(const ColorTheme& theme)
colors[ImGuiCol_ButtonHovered] = ImVec4(1.0f, 1.0f, 1.0f, 30.0f / 255.0f);
colors[ImGuiCol_ButtonActive] = ImVec4(1.0f, 1.0f, 1.0f, 45.0f / 255.0f);
} else {
colors[ImGuiCol_Button] = ImVec4(0, 0, 0, 0.05f);
colors[ImGuiCol_ButtonHovered] = ImVec4(0, 0, 0, 0.08f);
colors[ImGuiCol_ButtonActive] = ImVec4(0, 0, 0, 0.12f);
// Darker overlays on light themes — the old 5/8/12% were barely-there grey and washed out.
colors[ImGuiCol_Button] = ImVec4(0, 0, 0, 0.13f);
colors[ImGuiCol_ButtonHovered] = ImVec4(0, 0, 0, 0.20f);
colors[ImGuiCol_ButtonActive] = ImVec4(0, 0, 0, 0.28f);
}
// Headers (collapsing headers, tree nodes, selectable, menu items)

View File

@@ -1135,16 +1135,6 @@ inline std::string g_overlayCurrentKey;
// so every overlay shares one backdrop tone. `opacity` is the alpha (dialogs vary it per call).
inline ImVec4 OverlayScrimColor(float opacity) { return ImVec4(0.04f, 0.04f, 0.06f, opacity); }
// True when the active theme is light (app background luminance is high). Used to add extra
// separation where light-on-light would otherwise be low-contrast.
inline bool IsLightTheme() {
ImU32 bg = Background();
float r = ((bg >> IM_COL32_R_SHIFT) & 0xFF) / 255.0f;
float g = ((bg >> IM_COL32_G_SHIFT) & 0xFF) / 255.0f;
float b = ((bg >> IM_COL32_B_SHIFT) & 0xFF) / 255.0f;
return (0.299f * r + 0.587f * g + 0.114f * b) > 0.5f;
}
// Style of an overlay dialog. GlassCard = the classic scrim + glass card + boxed title bar.
// BlurFloat = the "Manage Portfolio" look: live-blur backdrop + floating content + plain heading.
enum class OverlayStyle { GlassCard, BlurFloat };
@@ -1273,12 +1263,6 @@ inline bool BeginOverlayDialog(const OverlayDialogSpec& spec)
GlassPanelSpec cardGlass;
cardGlass.rounding = 16.0f; cardGlass.fillAlpha = 35; cardGlass.borderAlpha = 50; cardGlass.borderWidth = 1.0f;
DrawGlassPanel(dl, cardMin, cardMax, cardGlass);
} else if (IsLightTheme()) {
// Floating content has no card, so in a LIGHT theme it sits light-on-light with almost no
// separation. Give it a faint elevated sheet + a defining edge for contrast (kept translucent
// to preserve the airy "floating" feel; dark themes already read fine, so they're unchanged).
dl->AddRectFilled(cardMin, cardMax, WithAlpha(Surface(), 60), 20.0f);
dl->AddRect(cardMin, cardMax, WithAlpha(OnSurface(), 55), 20.0f, 0, 1.5f);
}
// Click outside the card dismisses — but not on the appearing frame (the opening click) or while