chameleon v2.0.1-pre3 Chameleon.Keyword

Link to this section Summary

Functions

Converts a keyword color to its hex value

Converts a keyword color to its rgb value

Link to this section Types

Link to this type t()
t() :: %Chameleon.Keyword{keyword: String.t()}

Link to this section Functions

Link to this function keyword_to_hex_map()
Link to this function keyword_to_rgb_map()
Link to this function to_hex(keyword)
to_hex(Chameleon.Keyword.t()) ::
  Chameleon.Hex.t() |
  {:error, String.t()}

Converts a keyword color to its hex value.

Examples

iex> Chameleon.Keyword.to_hex(%Chameleon.Keyword{keyword: "Black"})
%Chameleon.Hex{hex: "000000"}
Link to this function to_rgb(keyword)
to_rgb(Chameleon.Keyword.t()) ::
  Chameleon.RGB.t() |
  {:error, String.t()}

Converts a keyword color to its rgb value.

Examples

iex> Chameleon.Keyword.to_rgb(%Chameleon.Keyword{keyword: "Red"})
%Chameleon.RGB{r: 255, g: 0, b: 0}