pub fn apply_colormap_spec(t: f64, spec: &ColormapSpec) -> (u8, u8, u8)Expand description
Maps a normalised value t ∈ [0, 1] to an (R, G, B) triple using spec.
Delegates to apply_colormap for ColormapSpec::Named and to the
built-in LUT interpolator for ColormapSpec::Custom.
§Examples
use ccalc_plot::colormap::{apply_colormap_spec, ColormapSpec};
let spec = ColormapSpec::Named("gray".to_string());
assert_eq!(apply_colormap_spec(0.0, &spec), (0, 0, 0));
assert_eq!(apply_colormap_spec(1.0, &spec), (255, 255, 255));