pub trait ColorMap<ColorType, FloatType = f32>
where ColorType: Color, FloatType: Float,
{ // Required method fn get_color_normalized( &self, h: FloatType, min: FloatType, max: FloatType ) -> ColorType; // Provided method fn get_color(&self, h: FloatType) -> ColorType { ... } }
Expand description

Converts scalar values to colors.

Required Methods§

source

fn get_color_normalized( &self, h: FloatType, min: FloatType, max: FloatType ) -> ColorType

A slight abstraction over get_color function where lower and upper bound can be specified.

Provided Methods§

source

fn get_color(&self, h: FloatType) -> ColorType

Takes a scalar value 0.0 <= h <= 1.0 and returns the corresponding color. Typically color-scales are named according to which color-type they return. To use upper and lower bounds with ths function see get_color_normalized.

Implementors§

source§

impl<FloatType> ColorMap<HSLColor, FloatType> for DerivedColorMap<HSLColor>
where FloatType: Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<HSLColor, FloatType> for MandelbrotHSL
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<HSLColor, FloatType> for VulcanoHSL
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBAColor, FloatType> for DerivedColorMap<RGBAColor>
where FloatType: Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBAColor, FloatType> for ViridisRGBA
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBColor, FloatType> for BlackWhite
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBColor, FloatType> for Bone
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBColor, FloatType> for Copper
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBColor, FloatType> for DerivedColorMap<RGBColor>
where FloatType: Float + FromPrimitive + ToPrimitive,

source§

impl<FloatType> ColorMap<RGBColor, FloatType> for ViridisRGB
where FloatType: Debug + Float + FromPrimitive + ToPrimitive,