Function zng_color::rgb

source ·
pub fn rgb<C: Into<RgbaComponent>>(red: C, green: C, blue: C) -> Rgba
Expand description

RGB color, opaque, alpha is set to 1.0.

§Arguments

The arguments can either be f32 in the 0.0..=1.0 range or u8 in the 0..=255 range or a percentage.

§Examples

use zng_color::rgb;

let red = rgb(1.0, 0.0, 0.0);
let green = rgb(0, 255, 0);