2 stable releases

Uses old Rust 2015

1.0.1 Oct 15, 2017

#10 in #hsv

Download history 3588/week @ 2024-01-03 4642/week @ 2024-01-10 4401/week @ 2024-01-17 4241/week @ 2024-01-24 4323/week @ 2024-01-31 5348/week @ 2024-02-07 6258/week @ 2024-02-14 4534/week @ 2024-02-21 4430/week @ 2024-02-28 5166/week @ 2024-03-06 14524/week @ 2024-03-13 11967/week @ 2024-03-20 5739/week @ 2024-03-27 7354/week @ 2024-04-03 6918/week @ 2024-04-10 4332/week @ 2024-04-17

25,675 downloads per month
Used in 5 crates (3 directly)

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

~14KB