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 to_cmyk(value)
to_cmyk([integer()]) :: [integer()]

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}
Link to this function to_hex(value)
to_hex([integer()]) :: charlist()

Converts an rgb color to its hex value.

Examples

iex> Chameleon.Rgb.to_hex([255, 0, 0])
"FF0000"
Link to this function to_hsl(value)
to_hsl([integer()]) :: [integer()]

Converts an rgb color to its hsl value.

Examples

iex> Chameleon.Rgb.to_hsl([255, 0, 0])
%{h: 0, s: 100, l: 50}
Link to this function to_keyword(value)
to_keyword([integer()]) :: charlist()

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."}
Link to this function to_pantone(value)
to_pantone([integer()]) :: charlist()

Converts an rgb color to its pantone value.

Examples

iex> Chameleon.Rgb.to_pantone([0, 0, 0])
"30"