Macro gradient_map

Source
macro_rules! gradient_map {
    [$($threshold:expr => $color:expr),*] => { ... };
}
Expand description

Helps construct a gradient map from colours.

You could construct the map yourself, however the purpose of this is mostly to provide an easily usable and clean way to construct a gradient map.

The following is an example usage of this macro:

let hsl: GradientMap<Hsl<Srgb>> = gradient_map!(
    0.00 => Hsl::new(0.0, 0.0, 0.0),
    1.00 => Hsl::new(0.0, 0.0, 1.0),
);