Skip to main content

Module palette

Module palette 

Source
Expand description

Named colours: a palette file ({"name": "#RRGGBB", ...}) that all drawing code refers to by name. The game says which names it needs; a theme is another palette file with exactly the names of the default one (theme_problems). As a format (ADR-0007): PaletteRon.

Structs§

PaletteDef
The validated palette: colour name → RGB.
PaletteRon
A palette file (palette, .ron), checked as PaletteDef::from_source says against the colours the game requires.

Functions§

format_hex
Formats RGB as lowercase #rrggbb.
line_of_key
1-based line of the first line containing "key", for error positions.
parse_hex
Parses #RRGGBB (hex digits in either case) into RGB.
theme_problems
What is wrong with theme palette (its file shown as file): it must define exactly the colour names of the default theme’s base (a name missing would leave something unpainted; an extra one is a typo).