Expand description
Theme-derived colour ramps. No hardcoded palette: a sequential ramp is
built from the theme’s bg → accent → glow, and a diverging ramp from
accent (low) through a neutral midpoint to glow (high). Charts call
Ramp::at with a normalised t ∈ 0..=1 to map a scalar to a colour.
Keeping this purely a function of facett_core::Theme means every chart
re-skins automatically when the theme switches — the requirement that no
component bakes in its own colours.
Structs§
- Ramp
- A colour ramp sampled at
t ∈ 0..=1. Built from theme colours so it follows the active palette.
Functions§
- lerp_
color - Linear interpolation between two colours in sRGB space (cheap, good enough
for chart fills).
t ∈ 0..=1. - normalize
- Normalise
vinto0..=1over[min, max]. Degenerate ranges map to0.5(a flat mid-tone) rather than dividing by zero.