#color #colors

color-maps

Defines X and HTML color maps

1 unstable release

0.1.0 Feb 27, 2021

#641 in Images

Download history 49/week @ 2023-06-04 17/week @ 2023-06-11 150/week @ 2023-06-18 89/week @ 2023-06-25 102/week @ 2023-07-02 59/week @ 2023-07-09 74/week @ 2023-07-16 78/week @ 2023-07-23 37/week @ 2023-07-30 70/week @ 2023-08-06 88/week @ 2023-08-13 46/week @ 2023-08-20 38/week @ 2023-08-27 68/week @ 2023-09-03 63/week @ 2023-09-10 59/week @ 2023-09-17

229 downloads per month
Used in 8 crates (3 directly)

MIT license

48KB
914 lines

color-maps

A simple crate which provides html and X color map with names (as keys) and their (r, g, b) values.

Usage

[dependencies]
color-maps = "0.1"
use color_maps::*;

fn main() {
    let html_black = html::HTML_MAP.get("Black").unwrap();
    assert_eq!(*html_black, (0, 0, 0));
    
    let x_black = x::X_MAP.get("black").unwrap();
    assert_eq!(*x_black, (0, 0, 0));
}

lib.rs:

color-maps

A simple crate which provides html and X color map with names (as keys) and their (r, g, b) values.

Usage

[dependencies]
color-maps = "0.1"
use color_maps::*;

fn main() {
    let html_black = html::HTML_MAP.get("Black").unwrap();
    assert_eq!(*html_black, (0, 0, 0));
   
    let x_black = x::X_MAP.get("black").unwrap();
    assert_eq!(*x_black, (0, 0, 0));
}

Dependencies

~11KB