Trait color_conv::Color [−][src]
Unifying Color
trait which encompasses each of the structs provided by
this crate.
Required methods
fn to_rgb(self) -> Rgb
[src]
Convert to Rgb
Examples
use color_conv::Color; use color_conv::Cmyk; use color_conv::Rgb; let cyan = Cmyk::new_unchecked(100, 0, 0, 0); let cyan_rgb = cyan.to_rgb(); assert_eq!(Rgb::new(0, 255, 255), cyan_rgb);
fn to_cmyk(self) -> Cmyk
[src]
Convert to Cmyk
with the possibility of failing if any of the
percentage values are above 100
Examples
use color_conv::Color; use color_conv::Rgb; use color_conv::Cmyk; let cyan = Rgb::new(0, 255, 255); let cyan_cmyk = cyan.to_cmyk(); assert_eq!(cyan_cmyk, Cmyk::new_unchecked(100, 0, 0, 0));
fn to_hsl(self) -> Hsl
[src]
Convert to Hsl
with the possibility of failing if any of the
percentage values are above 100 or degree values are above 360
Examples
use color_conv::Color; use color_conv::Hsl; use color_conv::Cmyk; let cyan = Hsl::new_unchecked(180, 100, 50); let cyan_cmyk = cyan.to_cmyk(); assert_eq!(cyan_cmyk, Cmyk::new_unchecked(100, 0, 0, 0));