Trait ColorMap
pub trait ColorMap
A color map
Associated Types
type Color;The color type on which the map operates on
Required Methods
fn index_of(&self, color: &Self::Color) -> usizeReturns the index of the closest match of
colorin the color map.fn map_color(&self, color: &mut Self::Color)Maps
colorto the closest color in the color map.
Provided Methods
fn lookup(&self, index: usize) -> Option<Self::Color>Looks up color by index in the color map. If
idxis out of range for the color map, orColorMapdoesn't implementlookupNoneis returned.fn has_lookup(&self) -> boolDetermine if this implementation of
ColorMapoverrides the defaultlookup.