Crates.io | tint |
lib.rs | tint |
version | 1.0.1 |
source | src |
created_at | 2017-10-15 14:57:18.533726 |
updated_at | 2017-10-15 15:03:10.61436 |
description | Color creation and manipulation |
homepage | https://github.com/savage13/tint |
repository | https://github.com/savage13/tint |
max_upload_size | |
id | 35746 |
size | 72,443 |
Color creation and manipulation in rust
Add this to your Cargo.toml
:
[dependencies]
tint = "1.0.0"
and this to your crate root:
extern crate tint;
extern crate tint;
use tint::Color;
fn main() {
let purple = Color::from("purple");
println!("purple: {}", purple);
// purple: (1.000, 0.000, 1.000, 1.000)
let green = Color::from("#00ff00");
println!("green: {}", green);
// green: (0.000, 1.000, 0.000, 1.000)
}
Basic and Extended Colors from W3C and SVG are supported, along with colors from the XKCD color database through tint::xkcd().
Name | Color |
---|---|
Black | |
Silver | |
Gray | |
White | |
Maroon | |
Red | |
Purple | |
Fuchsia | |
Green | |
Lime | |
Olive | |
Yellow | |
Navy | |
Blue | |
Teal | |
Aqua |