Crates.io | iro |
lib.rs | iro |
version | 0.0.1 |
source | src |
created_at | 2020-10-10 18:29:23.482344 |
updated_at | 2020-10-10 18:29:23.482344 |
description | Conversion between color spaces. |
homepage | |
repository | https://github.com/TianyiShi2001/iro |
max_upload_size | |
id | 298115 |
size | 18,979 |
and nothing else.
use iro::{Cmyk, CmykInt, Hsl, HslInt, Rgb};
use iro::{Cmyk, CmykInt, Hsl, HslInt, Rgb};
fn main() {
let color = Rgb::new(85, 191, 100);
println!("{:?}", &color);
let color: Cmyk = color.into();
println!("{:?}", &color);
let color: CmykInt = color.into();
println!("{:?}", (color.c, color.m, color.y, color.k));
println!("{:?}", &color);
let color = Hsl::from(Rgb::from(color));
println!("{:?}", &color);
let color: HslInt = color.into();
println!("{:?}", &color);
}
// Rgb { r: 85, g: 191, b: 100 }
// Cmyk { c: 0.5549738, m: 0.0, y: 0.47643983, k: 0.25098038 }
// (55, 0, 48, 25)
// CmykInt { c: 55, m: 0, y: 48, k: 25 }
// Hsl { h: 127.42857, s: 0.45064378, l: 0.54313725 }
// HslInt { h: 127, s: 45, l: 54 }
iro (色) is the Japanese word for "color".