tint

Crates.iotint
lib.rstint
version1.0.1
sourcesrc
created_at2017-10-15 14:57:18.533726
updated_at2017-10-15 15:03:10.61436
descriptionColor creation and manipulation
homepagehttps://github.com/savage13/tint
repositoryhttps://github.com/savage13/tint
max_upload_size
id35746
size72,443
(savage13)

documentation

README

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 #000000
Silver #c0c0c0
Gray #808080
White #ffffff
Maroon #800000
Red #ff0000
Purple #800080
Fuchsia #ff00ff
Green #008000
Lime #00ff00
Olive #808000
Yellow #ffff00
Navy #000080
Blue #0000ff
Teal #008080
Aqua #00ffff
Commit count: 14

cargo fmt