2 stable releases

Uses old Rust 2015

1.0.1 Oct 15, 2017

#997 in Images

Download history 7001/week @ 2024-07-25 6355/week @ 2024-08-01 6571/week @ 2024-08-08 7194/week @ 2024-08-15 7147/week @ 2024-08-22 10189/week @ 2024-08-29 9705/week @ 2024-09-05 7535/week @ 2024-09-12 6117/week @ 2024-09-19 6063/week @ 2024-09-26 7207/week @ 2024-10-03 9021/week @ 2024-10-10 9472/week @ 2024-10-17 12900/week @ 2024-10-24 11812/week @ 2024-10-31 12428/week @ 2024-11-07

48,866 downloads per month
Used in 6 crates (4 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