Skip to main content

Module color

Module color 

Source
Expand description

Colour and style resolution for readout body grammar (SRD-63 §5.2).

Three accept-shapes:

  1. Direct colour names — uppercase tokens like RED, BLUE, BRIGHT_GREEN, DIM. Map to ANSI SGR codes directly.
  2. Hex — #RRGGBB or #RGB. Map to ANSI truecolor (\x1b[38;2;r;g;bm).
  3. Style names — semantic, palette-resolved tokens like ERROR, WARN, INFO, OK, HEADER, MUTED. Resolve through the active palette (default WONG). Mapping is consistent across surfaces — the same ERROR style produces the same visual emphasis whether it lands in a readout, a plot legend (SRD-46), or a TUI panel.

Enums§

ColorSpec
Parsed colour or style spec. Carries enough information to produce an ANSI escape on demand without re-parsing.
Palette
Active palette. Default is Wong (colorblind-safe); matches the palette name SRD-46 reports default to.
StyleName
Semantic style names. Each maps to a palette entry per the active palette (default WONG); operators / future workloads can swap palettes.