pub enum ColorCycle {
Classic,
Vivid,
Balanced,
ColorblindSafe,
Monochrome,
}Expand description
Color rotation rules for multi-series plots. color(i) wraps around, so
any number of series can be colored consistently.
Variants§
Classic
Strong primary rotation starting at black — the classic lab-instrument increment list.
Vivid
High-saturation, high-contrast rotation — the look of biostatistics plotting tools, optimized for telling few series apart at a glance.
Balanced
Ten balanced mid-saturation hues (the public “tab10” palette) — the modern general-purpose default.
ColorblindSafe
The Okabe–Ito eight-color palette, designed to stay distinguishable under the common forms of color-vision deficiency.
Monochrome
Grayscale steps for print-safe single-ink figures.
Implementations§
Source§impl ColorCycle
impl ColorCycle
Sourcepub fn color(self, index: usize) -> Color
pub fn color(self, index: usize) -> Color
Color for the index-th series — wraps past the palette end, so it is
total over any series count.
pub fn len(self) -> usize
pub fn is_empty(self) -> bool
Sourcepub fn apply_to_series(self, series: &mut SeriesConfig, index: usize)
pub fn apply_to_series(self, series: &mut SeriesConfig, index: usize)
Recolor one series as the index-th member of this cycle: line,
scatter, and errorbar sub-styles all take the same cycle color.
Rebuild the series’ GPU style afterwards
(Renderer::create_style_for_series).
Sourcepub fn apply_to_all(self, series: &mut [SeriesConfig])
pub fn apply_to_all(self, series: &mut [SeriesConfig])
Recolor a whole series list in order: series i gets color(i).