[][src]Function colorskill::color_name_to_rgb

pub fn color_name_to_rgb(name: &str, fallback: (u8, u8, u8)) -> (u8, u8, u8)

Gets an RGB tuple from a color name.

The input is lowercased and the whitespaces are removed.

So "Light Blue" will match "lightblue".

A fallback RGB tuple must be provided.

Example

use colorskill::color_name_to_rgb;
let c = color_name_to_rgb("firebrick", (0, 0, 0));