struct
Color
pub struct Color {
pub r: f32,
pub g: f32,
pub b: f32,
pub a: f32,
}A color with components in 0.0..=1.0.
Fields
Methods
rgba
pub const fn rgba(r: f32, g: f32, b: f32, a: f32) -> ColorA colour from red, green, blue and alpha, each 0 to 1.
parse
pub fn parse(s: &str) -> Option<Color>Parse #rgb, #rrggbb, #rrggbbaa, rgb(…), hsl(…) (and their a forms) or a basic CSS color name.