mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:30:45 +00:00
5648a37317
## Summary The "classic icons" graphics setting currently renders structure icon glyphs as flat black. In the v0.31 canvas renderer, classic icons used `structureColors().dark` — a darkened version of the owning player's territory color. This PR restores that look in the WebGL renderer. - New `structure.iconDarken` render setting (HSV value multiplier on the player fill color; `0` = off, default). - New `uIconDarken` uniform in `structure.frag.glsl`: when > 0, the glyph color is `darken(playerFill, uIconDarken)` instead of the flat `uIconColor`. - Classic mode (`classicIcons: true`) now sets `iconDarken = 0.45` instead of `iconR/G/B = 0`. Border darken, fill, and the 0.75 translucency are unchanged. - Default (non-classic) icons are unaffected (white glyph, `iconDarken = 0`). Under-construction structures keep the gray fill, so their glyph darkens to a darker gray — matching v31's construction styling. ## Verification Drove a solo game headlessly with classic icons on and built structures: glyphs render as darkened versions of each player's color (dark purple on a purple player, per-bot hues on bot structures). Pixel-sampled the screenshot: glyph measured `rgb(89,58,142)` vs `rgb(84,50,139)` predicted for the 0.45-darkened player color at 0.75 alpha (flat black would measure `rgb(38,26,60)`). Control run with classic off shows the unchanged white glyph. `tests/GraphicsOverrides.test.ts` updated; all pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>