chameleon v1.0.3 Chameleon.Rgb
Link to this section Summary
Functions
Converts an rgb color to its cmyk value
Converts an rgb color to its hex value
Converts an rgb color to its hsl value
Converts an rgb color to its keyword value
Converts an rgb color to its pantone value
Link to this section Functions
Link to this function
keyword_to_rgb_map()
Converts an rgb color to its cmyk value.
Examples
iex> Chameleon.Rgb.to_cmyk([255, 0, 0])
%{c: 0, m: 100, y: 100, k: 0}
Converts an rgb color to its hsl value.
Examples
iex> Chameleon.Rgb.to_hsl([255, 0, 0])
%{h: 0, s: 100, l: 50}
Converts an rgb color to its keyword value.
Examples
iex> Chameleon.Rgb.to_keyword([255, 0, 0])
"red"
iex> Chameleon.Rgb.to_keyword([255, 75, 42])
{:error, "No keyword match could be found for that rgb value."}