Expand description
Color creation and manipulation
use tint::Color;
use tint::Colour; // Alternatively
let green = Color::from("green");
let green = Color::from("00FF00");
let green = Color::from("00ff00");
let green = Color::from("#00ff00");
let green = Color::from("#00FF00");
let green = Color::from((0,255,0));
let green = Color::from([0.,1.,0.]);
let green = Color::from(vec![0.,1.,0.]);
let green = Color::from(vec![0.,1.,0.,1.0]);
let green = Color::from(&vec![0.,1.,0.]);
let green = Color::from(&vec![0.,1.,0.,1.0]);
let green = Color::new(0.0, 1.0, 0.0, 1.0);
let green = Color::from_rgb1(0.0, 1.0, 0.0);
let green = Color::from_rgb1v(&[0.0, 1.0, 0.0]);
let green = Color::name("green");
let green = Colour::name("green");
§Color names
Typical names (HTML and SVG) are available by default, and color names defined in the XKCD color database are available by running the xkcd() function
§Basic Colors
https://www.w3.org/TR/css3-color/#html4
§Extended Colors
https://www.w3.org/TR/css3-color/#svg-color
§XKCD Colors
https://xkcd.com/color/rgb/
Structs§
- Color
- Color value
Functions§
- compare_
by_ hsv - Compare Colors by hue, then saturation, then value
- compare_
by_ rgb - Compare Colors by red, then green, then blue
- load_
rgb_ buffer - Load a buffer into the existing Named Color database.
- load_
rgb_ file - Load a file into the existing Named Color database.
- names
- Return names of available named colors
- read_
buffer - Load a buffer and return a Vec<String, Color)> of names and colors
- read_
file - Read a file and return a Vec<String, Color)> of names and colors
- xkcd
- Load colors from the XKCD Color Database