Repository navigation
feat: recolour art and text at runtime from a named palette - #105
Merged
Merged
Conversation
A tint handle names a palette of colors. Art tinted by one leaves the static composite and becomes an art layer drawn at its authored place, with untinted art authored over it; text takes the palette color. Shader-placed HUDs get one marker per palette entry per tinted segment. A hex tint is multiplied into the art at build time. Refs #91, #92
/tone <ok|warn|danger|auto> pins the tone for debugging.
Preview state takes a tint handle with one of its palette entry names, defaulting to the first. Art layers draw at their authored place multiplied by that color, tinted text and runtime sprites take it, and art layers count toward the canvas bounds and the pixel limit.
…hader does The generated shader scales the display color by 0.25 without truncating, so truncating each channel drew some shadows one step darker than the client.
oglassdev
added this pull request to stack #101
October 11, 2026 06:19
…nd runtime layers Report an error instead of looping when shader HUD segments outnumber marker IDs, reuse an untinted art layer only while it is the last runtime layer, and carry a switch case's art coverage into the enclosing run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A UI could only change colour by swapping whole sprites: a "warning" state needed its own copy of every piece of art, and text colour was fixed at build time. Now art and text can take a colour from a small named palette that the server picks at runtime, so one set of art serves every state.
tint(id, palette)declares a handle with a fixed palette.tinton a<Box>or<Case>frame and on<Image>takes the handle or a literal hex;coloron text takes the handle.[tone, "danger"]as state and draw the chosen entry; the default is the first entry.Cost: each tinted piece of art becomes its own font glyph instead of joining the static background glyph. In shader-placed HUDs each tinted segment also uses one marker colour per palette entry.
A shader-placed HUD that needs more than 65,535 marker colours fails the build with a message.
The example adds a
/tonecommand that tints the wave hint HUD and a status lamp in the shop.Checked in a real 26.2 client: the HUD pill's rim, fill and text and the shop lamp show the exact palette colours and multiply products in all three tones, and the previews of the HUD match the client pixel for pixel in each tone. That comparison found the preview's HUD text shadow one step dark in some colours; previews now round it as the shader does, which applies to every shader-placed HUD preview.
Not included:
tinton a window, HUD root, section or collection frame.Not checked against a client: tinted runtime sprite slots (
<Image bind tint>) and previews of tinted non-shader HUDs.Closes #91. Closes #92.
Checks:
just test-rust -p window-core,just gradle :runtime:test --rerun,just check-ts,just test-ts,just golden,just lint,just fmt-check.Stacked on #104.
🤖 Generated with Claude Code