Skip to main content

Module palette

Module palette 

Source
Expand description

Categorical series palette — a small, validated set of hues assigned to chart series in a fixed order, never a random per-string hash. Line/bar/scatter series are identity-coded (which series is which), so this is the categorical job from the dataviz method: a fixed order maximising the minimum adjacent colour-vision-deficiency separation, with a light-surface and a dark-surface step of the same eight hues (not two unrelated palettes).

The set below is the dataviz reference categorical palette (worst adjacent CVD ΔE 24.2 on light, 10.3 on dark — validated as a set, not eyeballed). Which column is used follows the active Theme: a dark theme surface gets the dark steps, a light one the light steps — so the palette re-skins with the theme without ever baking a colour into a component. Past the eighth series the order cycles (a documented floor; real dashboards fold a 9th series into “Other”).

Constants§

SLOTS
The number of validated categorical slots before the order must cycle.

Functions§

series_color
The colour for series index i, assigned in fixed order and cycling past the eighth slot. Identity follows the slot, never the value — so a series keeps its colour regardless of how many others are present.
series_palette
The categorical palette for the active theme, in fixed slot order. Dark themes get [DARK], light themes [LIGHT] — the same eight hues, stepped per surface.