Rust library named-colour
The rust library named-colour provides a convenient set of named colours and the Hex Code for each colour.
Installation
To use named-colour in your project you can add the following to your Cargo.toml:
[]
= "0.3.25"
Usage
Provides Hex Codes for colours:
- enums that return a hex code string for named colours
- rgb colour struct to configure a colour an rgb colour and display as decimal or hex
Examples
Use Basic colour
use Basic;
println!;
Use Extended colour
Enable the feature in the toml file:
[]
= { = "0.3.25", = ["extended"]}
use Indigo;
println!;
Create a custom colour
use ColourRgb;
let my_colour =new;
println!;
Features
- Basic contains just 16 colours with 18 names (default)
- Extended contains a fuller set of colours divided in 11 collections
To use the extended colour set only configure toml with no-default features
[]
= { = "0.3.25", = false, = ["extended"]}
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.