pub trait ColorMap<ColorType, FloatType = f32>{
// 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§
sourcefn get_color_normalized(
&self,
h: FloatType,
min: FloatType,
max: FloatType
) -> ColorType
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§
sourcefn get_color(&self, h: FloatType) -> ColorType
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.