Raxol.Terminal.Color.TrueColor.Palette (Raxol Terminal v2.6.0)

Copy Markdown View Source

Named color constants and lookup for TrueColor.

Summary

Functions

Returns the full map of named colors.

Looks up a named color and returns {:ok, {r, g, b}} or {:error, :unknown_color_name}.

Types

color_name()

@type color_name() ::
  :black
  | :white
  | :red
  | :green
  | :blue
  | :yellow
  | :magenta
  | :cyan
  | :orange
  | :purple
  | :pink
  | :brown
  | :gray
  | :lime
  | :navy
  | :olive
  | :silver
  | :teal

Functions

all()

@spec all() :: %{required(color_name()) => {0..255, 0..255, 0..255}}

Returns the full map of named colors.

lookup(name)

@spec lookup(atom() | binary()) ::
  {:ok, {0..255, 0..255, 0..255}} | {:error, :unknown_color_name}

Looks up a named color and returns {:ok, {r, g, b}} or {:error, :unknown_color_name}.