pub trait ColorMap<ColorType: Color, FloatType = f32>where
    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§