1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
/*! Convert values to color simply and securely. - Convert in hexadecimal, rgb, hsl, cmyk and hsv formats. - Sensitive case. - Always returns the same result for a string (Pure function). [![Crates.io](https://img.shields.io/crates/v/coloring)](https://crates.io/crates/coloring) • [![Crates.io](https://img.shields.io/crates/l/coloring)](https://github.com/andrelmlins/coloring/blob/master/LICENSE) • [![Build Status](https://travis-ci.com/andrelmlins/coloring.svg?branch=master)](https://travis-ci.com/andrelmlins/coloring) • [![API](https://docs.rs/coloring/badge.svg)](https://docs.rs/coloring) ## Installation Add the dependency in the `Cargo.toml` file: ```toml [dependencies] coloring = "0.3" ``` ## Basic Use ```rust extern crate coloring; pub use 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] } ``` */ mod coloring; pub use crate::coloring::Coloring; // pub use coloring::Coloring;