2 stable releases
Uses old Rust 2015
1.0.1 | Oct 15, 2017 |
---|
#10 in #hsv
25,353 downloads per month
Used in 5 crates
(3 directly)
32KB
636 lines
tint
Color creation and manipulation in rust
Usage
Add this to your Cargo.toml
:
[dependencies]
tint = "1.0.0"
and this to your crate root:
extern crate tint;
Example
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)
}
Color names
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 |
Dependencies
~14KB