Skip to main content

ColorCycle

Enum ColorCycle 

Source
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

Source

pub fn colors(self) -> &'static [Color]

The full palette in rotation order.

Source

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.

Source

pub fn len(self) -> usize

Source

pub fn is_empty(self) -> bool

Source

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).

Source

pub fn apply_to_all(self, series: &mut [SeriesConfig])

Recolor a whole series list in order: series i gets color(i).

Trait Implementations§

Source§

impl Clone for ColorCycle

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ColorCycle

Source§

impl Debug for ColorCycle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for ColorCycle

Source§

impl PartialEq for ColorCycle

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ColorCycle

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.