Raxol.Terminal.Emulator.Style (Raxol v0.5.0)
View SourceHandles text styling and formatting for the terminal emulator. Provides functions for managing character attributes, colors, and text formatting.
Summary
Functions
Gets the current text style. Returns the current style.
Resets all text attributes to default. Returns {:ok, updated_emulator}.
Sets multiple style attributes at once.
Sets the background color. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the text blink mode. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the text decoration (underline, strikethrough, etc.). Returns {:ok, updated_emulator} or {:error, reason}.
Sets the foreground color. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the text intensity (bold, faint). Returns {:ok, updated_emulator} or {:error, reason}.
Sets the text inverse mode. Returns {:ok, updated_emulator} or {:error, reason}.
Sets the text visibility. Returns {:ok, updated_emulator} or {:error, reason}.
Types
Functions
@spec get_style(Raxol.Terminal.Emulator.Struct.t()) :: Raxol.Terminal.ANSI.TextFormatting.text_style()
Gets the current text style. Returns the current style.
@spec reset_attributes(Raxol.Terminal.Emulator.Struct.t()) :: {:ok, Raxol.Terminal.Emulator.Struct.t()}
Resets all text attributes to default. Returns {:ok, updated_emulator}.
@spec set_attributes(Raxol.Terminal.Emulator.Struct.t(), list()) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets multiple style attributes at once.
@spec set_background(Raxol.Terminal.Emulator.Struct.t(), atom() | tuple()) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the background color. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_blink(Raxol.Terminal.Emulator.Struct.t(), :none | :slow | :rapid) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the text blink mode. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_decoration(Raxol.Terminal.Emulator.Struct.t(), atom()) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the text decoration (underline, strikethrough, etc.). Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_foreground(Raxol.Terminal.Emulator.Struct.t(), atom() | tuple()) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the foreground color. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_intensity(Raxol.Terminal.Emulator.Struct.t(), :normal | :bold | :faint) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the text intensity (bold, faint). Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_inverse(Raxol.Terminal.Emulator.Struct.t(), boolean()) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the text inverse mode. Returns {:ok, updated_emulator} or {:error, reason}.
@spec set_visibility(Raxol.Terminal.Emulator.Struct.t(), :visible | :hidden) :: {:ok, Raxol.Terminal.Emulator.Struct.t()} | {:error, String.t()}
Sets the text visibility. Returns {:ok, updated_emulator} or {:error, reason}.