Crate colorbrewer [−] [src]
Library providing colors from ColorBrewer.
Licensed under Apache License, Version 2.0.
Use one member of the
Enum and the requested number of colors
to get the corresponding color ramp with the
use colorbrewer::*; let ramp_orange = get_color_ramp(Palette::Oranges, 3); assert_eq!(Some(vec!["#fee6ce", "#fdae6b", "#e6550d"]), ramp_orange);
One can also get the corresponding
Palette enum variant from it's name as a String
as it implements the
use colorbrewer::*; let blue_pal: Palette = "Blues".parse().unwrap(); assert_eq!(blue_pal, Palette::Blues); let ramp = get_color_ramp(blue_pal, 3);
Colors are described by their hexadecimal code.
These color specifications and designs are developed by Cynthia Brewer (http://colorbrewer2.org/).
Available color palettes
Function to get the requested color ramp
according to a given name and number of colors.