Expand description
Shared styling: a color-blind-safe default palette and small helpers for
building ShapeStyles, used by every chart type so the crate’s output is
visually consistent.
The default palette is the Okabe–Ito qualitative palette, designed to be distinguishable under the common forms of color-vision deficiency.
Okabe, M. & Ito, K. (2008). Color Universal Design (CUD): How to make figures and presentations that are friendly to colorblind people. https://jfly.uni-koeln.de/color/
Constants§
- DEFAULT_
FONT - Default label / axis font family used across the crate’s examples.
- DEFAULT_
FONT_ SIZE - Default font size (points) for legend and annotation text.
- OKABE_
ITO - The eight Okabe–Ito colors as
(r, g, b)triples, in the recommended order.
Functions§
- fill_
style - A solid-fill
ShapeStyleof the given color (filled = true). - palette_
color - Returns the
i-th palette color, cycling through the seven non-black Okabe–Ito hues. Deterministic, so the k-th series always gets the same color across every chart type. - rgba
- Convenience: a fully-specified
RGBAColorwith explicit alpha. - stroke_
style - A stroked (outline)
ShapeStyleof the given color and width (filled = false). - translucent_
fill - A translucent fill built from
colorat the givenalpha(0.0–1.0).