Pote — canonical color types, default palette, and top-level helpers.

This module defines the core color type definitions used throughout the entire library and provides access to the built-in default color palette.

Summary

Functions

Returns a specific color by name (alias for get_color/1).

Checks if a color name exists in the default palette.

Returns all available color names.

Returns the default color palette.

Looks up a color by atom name. Returns RGB tuple or nil.

Types

argb()

cmyk()

@type cmyk() :: {float(), float(), float(), float()}

color_input()

@type color_input() ::
  rgb() | hex() | hsl() | hsv() | cmyk() | xterm256() | atom() | String.t()

color_output()

@type color_output() :: rgb() | nil

hex()

@type hex() :: String.t()

hsl()

@type hsl() :: {float(), float(), float()}

hsv()

@type hsv() :: {float(), float(), float()}

rgb()

xterm256()

@type xterm256() :: 0..255

Functions

color(name)

@spec color(atom()) :: {integer(), integer(), integer()} | nil

Returns a specific color by name (alias for get_color/1).

color_exists?(name)

@spec color_exists?(atom()) :: boolean()

Checks if a color name exists in the default palette.

color_names()

@spec color_names() :: [atom()]

Returns all available color names.

default_colors()

@spec default_colors() :: map()

Returns the default color palette.

get_color(name)

@spec get_color(atom()) :: {integer(), integer(), integer()} | nil

Looks up a color by atom name. Returns RGB tuple or nil.