pub enum Colormap {
Turbo,
Viridis,
Coolwarm,
Grayscale,
Custom(Vec<(f32, [u8; 4])>),
}Expand description
A colormap from t in [0, 1] to RGBA8.
Variants§
Turbo
Google’s Turbo rainbow (published table).
Viridis
Matplotlib’s perceptually uniform Viridis (polynomial fit).
Coolwarm
Moreland’s blue-white-red diverging map.
Grayscale
Linear black to white.
Custom(Vec<(f32, [u8; 4])>)
Colour stops (position, rgba): at least two, positions in [0, 1]
and strictly increasing. Colours are interpolated linearly per channel
and rounded; t before the first or after the last stop takes that
stop’s colour.
Trait Implementations§
impl StructuralPartialEq for Colormap
Auto Trait Implementations§
impl Freeze for Colormap
impl RefUnwindSafe for Colormap
impl Send for Colormap
impl Sync for Colormap
impl Unpin for Colormap
impl UnsafeUnpin for Colormap
impl UnwindSafe for Colormap
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more