[][src]Type Definition colors_transform::ColorTuple

type ColorTuple = (f32, f32, f32);

Tuple type just for data exchange. May be a:

  • ($red,$green,$blue) (0.0..255.0, 0.0..255.0, 0.0..255.0)

or

  • ($hue, $saturation, $lightness) (0.0..359.0, 0.0..100.0, 0.0..100.0)

Example

use colors_transform::{Rgb,Color,Hsl};

let rgb = Rgb::from_tuple(&(255.0,13.0,177.0));
assert_eq!(rgb.get_red(), 255.0);

let hsl: Hsl = "hsl(315,99,12)".parse().unwrap();
assert_eq!(hsl.get_saturation(), 99.0);