2 stable releases

1.0.1 Oct 15, 2017

#116 in Images

Download history 719/week @ 2019-12-02 385/week @ 2019-12-09 477/week @ 2019-12-16 517/week @ 2019-12-23 602/week @ 2019-12-30 752/week @ 2020-01-06 610/week @ 2020-01-13 1207/week @ 2020-01-20 977/week @ 2020-01-27 622/week @ 2020-02-03 639/week @ 2020-02-10 637/week @ 2020-02-17 610/week @ 2020-02-24 952/week @ 2020-03-02 617/week @ 2020-03-09 601/week @ 2020-03-16

2,532 downloads per month
Used in 2 crates

MIT license

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 #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

Dependencies