Module palette::named
[−]
[src]
A collection of named color constants. Can be toggled with the "named"
Cargo feature.
They are taken from the SVG keyword colors (same as in CSS3) and they can be used as if they were pixel values:
use palette::Srgb; use palette::named; //From constant let from_const = Srgb::<f32>::from_pixel(&named::OLIVE).into_linear(); //From name string let olive = named::from_str("olive").expect("unknown color"); let from_str = Srgb::from_pixel(&olive).into_linear(); assert_eq!(from_const, from_str);
Constants
Functions
from_str |
Get a SVG/CSS3 color by name. Can be toggled with the |