| Crates.io | coloring |
| lib.rs | coloring |
| version | 0.3.1 |
| created_at | 2020-07-21 21:52:50.376429+00 |
| updated_at | 2020-07-23 20:00:07.448256+00 |
| description | Convert values to color simply and securely. |
| homepage | |
| repository | https://github.com/andrelmlins/coloring |
| max_upload_size | |
| id | 267809 |
| size | 11,023 |
Convert values to color simply and securely.
Add the dependency in the Cargo.toml file:
[dependencies]
coloring = "0.3"
extern crate coloring::Coloring;
fn main() {
let coloring = Coloring::new("My String");
println!("{}", coloring.to_hexadecimal());
// #259f0c
println!("{:?}", coloring.to_rgb());
// [37, 159, 12]
println!("{:?}", coloring.to_hsl());
// [110.0, 86.0, 34.0]
println!("{:?}", coloring.to_cmyk());
// [77.0, 0.0, 92.0, 38.0]
println!("{:?}", coloring.to_hsv());
// [110.0, 86.0, 34.0]
}
Coloring is open source software licensed as MIT.