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

View Source

Manages terminal text formatting and styling operations.

Summary

Functions

Applies a new format to the current state.

Applies formatting to a string.

Gets the current formatting state.

Creates a new formatting manager instance.

Resets the current format to default values.

Restores the previously saved format state.

Saves the current format state.

Sets the background color.

Sets the font number.

Sets the foreground color.

Toggles blink formatting.

Toggles bold formatting.

Toggles conceal formatting.

Toggles faint formatting.

Toggles italic formatting.

Toggles reverse video formatting.

Toggles strikethrough formatting.

Toggles underline formatting.

Types

format()

@type format() :: %{
  bold: boolean(),
  faint: boolean(),
  italic: boolean(),
  underline: boolean(),
  blink: boolean(),
  reverse: boolean(),
  conceal: boolean(),
  strikethrough: boolean(),
  foreground: Raxol.Terminal.Color.color() | nil,
  background: Raxol.Terminal.Color.color() | nil,
  font: non_neg_integer()
}

t()

@type t() :: %Raxol.Terminal.Formatting.Manager{
  current_format: format(),
  saved_format: format() | nil
}

Functions

apply_format(state, format)

Applies a new format to the current state.

apply_formatting(state, text)

Applies formatting to a string.

get_format(state)

Gets the current formatting state.

new()

Creates a new formatting manager instance.

reset_format(state)

Resets the current format to default values.

restore_format(state)

Restores the previously saved format state.

save_format(state)

Saves the current format state.

set_background(state, color)

Sets the background color.

set_font(state, font)

Sets the font number.

set_foreground(state, color)

Sets the foreground color.

toggle_blink(state)

Toggles blink formatting.

toggle_bold(state)

Toggles bold formatting.

toggle_conceal(state)

Toggles conceal formatting.

toggle_faint(state)

Toggles faint formatting.

toggle_italic(state)

Toggles italic formatting.

toggle_reverse(state)

Toggles reverse video formatting.

toggle_strikethrough(state)

Toggles strikethrough formatting.

toggle_underline(state)

Toggles underline formatting.