Expand description
Colors: Rgb values and the Palette of named colors (game ADR-0012).
Code refers to colors by name, never raw RGB. The colors a game’s code
needs are its ColorSet, an enum whose every name the palette must
have, so a missing name is impossible at render time; the engine’s own
widgets ask for the few EngineColors, which the game’s set names.
Data-driven names (terrain) go through Palette::lookup and are
validated when their content is loaded.
Structs§
- Palette
- Named colors, built from the validated
PaletteDeffor a game’sColorSet. - Rgb
- A 24-bit RGB colour. Ordered red, then green, then blue: an order for maps, not a look.
Enums§
- Engine
Color - The colors the engine’s own widgets ask for. A game’s
ColorSetsays which of its palette’s names each one is (engine_name).
Constants§
- DIM_
DARK - How bright a dimmed colour is left (
1= as bright as it was). Tunable: the first renders used 0.6; Nick, seeing it in the game on 2026-10-03, chose to lighten it a bit (ticket 0436). - DIM_
GREY - How far a dimmed colour goes to its own grey (
0= not at all,1= grey). Tunable.
Traits§
- Color
Set - The colors a game’s code draws with, by name: usually an enum, whose every name its palette must have.
Functions§
- required_
names - Every name a palette for the set
Cmust have: the set’s, in its order, then the engine colors’ that it doesn’t already name. - to_
channel - Rounds and saturates a channel value to
0..=255.