Raxol.Terminal.Color.Manager (Raxol v0.5.0)

View Source

Manages terminal colors and color operations.

Summary

Functions

Converts a color to RGB format.

Gets a specific color by name.

Gets all current colors.

Gets the default color palette.

Merges a new palette with the existing one.

Creates a new color manager instance.

Resets all colors to their default values.

Sets a specific color by name.

Sets multiple colors at once.

Sets a custom color palette.

Types

color()

@type color() :: :default | {0..255, 0..255, 0..255} | atom()

color_map()

@type color_map() :: %{required(atom()) => color()}

t()

@type t() :: %Raxol.Terminal.Color.Manager{
  colors: %{foreground: color(), background: color(), palette: color_map()},
  default_palette: color_map()
}

Functions

color_to_rgb(state, color)

Converts a color to RGB format.

get_color(state, name)

Gets a specific color by name.

get_colors(state)

Gets all current colors.

get_default_palette(state)

Gets the default color palette.

merge_palette(state, palette)

Merges a new palette with the existing one.

new(opts \\ [])

Creates a new color manager instance.

reset_colors(state)

Resets all colors to their default values.

set_color(state, name, value)

Sets a specific color by name.

set_colors(state, colors)

Sets multiple colors at once.

set_palette(state, palette)

Sets a custom color palette.