fix(ui): darken the logo SVG detail on light skins
The SVG's white highlight (detail) washed out against a light card/background on light skins — the dragon's wings/detail nearly vanished, leaving only the accent body. Make the detail colour theme-aware: white on dark skins (unchanged), the theme's on-surface colour (dark) on light skins, so the full mark reads on both. Applies to the header logo and the balance coin icon; re-rasterizes on the dark↔light flip (already tracked by the logo guard). The fixed-brand ":drgx:" emoji is unaffected (its crimson body carries white detail fine on any bubble). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1375,6 +1375,9 @@ void App::ensureLogoTexture()
|
|||||||
logo_loaded_ = true;
|
logo_loaded_ = true;
|
||||||
logo_is_dark_variant_ = wantDark;
|
logo_is_dark_variant_ = wantDark;
|
||||||
logo_accent_ = logoAccent;
|
logo_accent_ = logoAccent;
|
||||||
|
// The SVG's white highlight (detail) stays white on dark skins, but darkens to the theme's on-surface
|
||||||
|
// colour on light skins so it doesn't wash out against a light card/background.
|
||||||
|
const ImU32 detailCol = wantDark ? IM_COL32(255, 255, 255, 255) : ui::material::OnSurface();
|
||||||
if (logo_tex_) util::DestroyTexture(logo_tex_); // free the previous texture before replacing
|
if (logo_tex_) util::DestroyTexture(logo_tex_); // free the previous texture before replacing
|
||||||
logo_tex_ = 0; logo_w_ = 0; logo_h_ = 0;
|
logo_tex_ = 0; logo_w_ = 0; logo_h_ = 0;
|
||||||
|
|
||||||
@@ -1384,7 +1387,7 @@ void App::ensureLogoTexture()
|
|||||||
if (coin_logo_tex_) util::DestroyTexture(coin_logo_tex_);
|
if (coin_logo_tex_) util::DestroyTexture(coin_logo_tex_);
|
||||||
coin_logo_tex_ = 0; coin_logo_w_ = 0; coin_logo_h_ = 0;
|
coin_logo_tex_ = 0; coin_logo_w_ = 0; coin_logo_h_ = 0;
|
||||||
coin_logo_loaded_ = true;
|
coin_logo_loaded_ = true;
|
||||||
if (!util::LoadTextureFromSvg(embedded::kLogoDragonXSvg, 128, logoAccent, IM_COL32(255, 255, 255, 255),
|
if (!util::LoadTextureFromSvg(embedded::kLogoDragonXSvg, 128, logoAccent, detailCol,
|
||||||
&coin_logo_tex_, &coin_logo_w_, &coin_logo_h_)) {
|
&coin_logo_tex_, &coin_logo_w_, &coin_logo_h_)) {
|
||||||
auto coinElem = ui::schema::UI().drawElement("components.main-window", "coin-icon");
|
auto coinElem = ui::schema::UI().drawElement("components.main-window", "coin-icon");
|
||||||
auto cit = coinElem.extraColors.find("icon");
|
auto cit = coinElem.extraColors.find("icon");
|
||||||
@@ -1405,7 +1408,7 @@ void App::ensureLogoTexture()
|
|||||||
// at ~2x the 128px viewBox for crisp downscaling. This is the branding on every skin; the per-skin
|
// at ~2x the 128px viewBox for crisp downscaling. This is the branding on every skin; the per-skin
|
||||||
// PNG path below is only a fallback if rasterization ever fails.
|
// PNG path below is only a fallback if rasterization ever fails.
|
||||||
if (util::LoadTextureFromSvg(embedded::kLogoDragonXSvg, 256, logoAccent,
|
if (util::LoadTextureFromSvg(embedded::kLogoDragonXSvg, 256, logoAccent,
|
||||||
IM_COL32(255, 255, 255, 255), &logo_tex_, &logo_w_, &logo_h_)) {
|
detailCol, &logo_tex_, &logo_w_, &logo_h_)) {
|
||||||
DEBUG_LOGF("Rendered DragonX SVG logo (%dx%d, accent %08X)\n", logo_w_, logo_h_, logoAccent);
|
DEBUG_LOGF("Rendered DragonX SVG logo (%dx%d, accent %08X)\n", logo_w_, logo_h_, logoAccent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user