Raxol.Terminal.Colors (Raxol v0.5.0)

View Source

Manages terminal colors and color-related operations.

Summary

Functions

Gets the current background color.

Gets the current cursor color.

Gets the current foreground color.

Gets the current selection background color.

Gets the current selection foreground color.

Resets the background color to default.

Resets the cursor color to default.

Resets the foreground color to default.

Resets the selection background color to default.

Resets the selection foreground color to default.

Sets the background color.

Sets the cursor color.

Sets the foreground color.

Sets the selection background color.

Sets the selection foreground color.

Types

color()

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

t()

@type t() :: %Raxol.Terminal.Colors{
  background: color(),
  cursor_color: color(),
  foreground: color(),
  selection_background: color(),
  selection_foreground: color()
}

Functions

get_background(colors)

@spec get_background(t()) :: color()

Gets the current background color.

get_cursor_color(colors)

@spec get_cursor_color(t()) :: color()

Gets the current cursor color.

get_foreground(colors)

@spec get_foreground(t()) :: color()

Gets the current foreground color.

get_selection_background(colors)

@spec get_selection_background(t()) :: color()

Gets the current selection background color.

get_selection_foreground(colors)

@spec get_selection_foreground(t()) :: color()

Gets the current selection foreground color.

reset_background(colors)

@spec reset_background(t()) :: {:ok, t()}

Resets the background color to default.

reset_cursor_color(colors)

@spec reset_cursor_color(t()) :: {:ok, t()}

Resets the cursor color to default.

reset_foreground(colors)

@spec reset_foreground(t()) :: {:ok, t()}

Resets the foreground color to default.

reset_selection_background(colors)

@spec reset_selection_background(t()) :: {:ok, t()}

Resets the selection background color to default.

reset_selection_foreground(colors)

@spec reset_selection_foreground(t()) :: {:ok, t()}

Resets the selection foreground color to default.

set_background(colors, color)

@spec set_background(t(), color()) :: t()

Sets the background color.

set_cursor_color(colors, color)

@spec set_cursor_color(t(), color()) :: t()

Sets the cursor color.

set_foreground(colors, color)

@spec set_foreground(t(), color()) :: t()

Sets the foreground color.

set_selection_background(colors, color)

@spec set_selection_background(t(), color()) :: t()

Sets the selection background color.

set_selection_foreground(colors, color)

@spec set_selection_foreground(t(), color()) :: t()

Sets the selection foreground color.