ETee.Color (e_tee v0.1.0)

Copy Markdown View Source

A cell colour: terminal default, a palette index, or a direct RGB triple.

Palette indices are stored unresolved, leaving indices 0..15 open to a consumer's own theme. to_rgb/1 resolves an index against the standard xterm palette.

Summary

Functions

True when the colour is a palette index.

True when the colour is a direct RGB triple.

Resolve a colour to an RGB triple using the standard xterm palette.

Types

rgb()

@type rgb() :: {0..255, 0..255, 0..255}

t()

@type t() :: :default | 0..255 | rgb()

Functions

indexed?(color)

@spec indexed?(t()) :: boolean()

True when the colour is a palette index.

rgb?(arg1)

@spec rgb?(t()) :: boolean()

True when the colour is a direct RGB triple.

to_rgb(rgb)

@spec to_rgb(t()) :: rgb() | nil

Resolve a colour to an RGB triple using the standard xterm palette.

Returns nil for :default, which only the consumer can resolve.