Raxol.Terminal.StyleBuffer (Raxol v2.0.1)
View SourceManages terminal style state and operations. This module handles text attributes, colors, and formatting for terminal output.
Summary
Functions
Applies a style to a rectangular region.
Gets the default style.
Gets the current style.
Gets the style at a specific position (x, y). Returns the style at the position or the current style if not set.
Merges two styles.
Creates a new style buffer with the given dimensions.
Resets the style to default.
Sets text attributes (list of atoms).
Sets the background color.
Sets the default style.
Sets the foreground color.
Validates a style map.
Types
@type position() :: {non_neg_integer(), non_neg_integer()}
@type t() :: %Raxol.Terminal.StyleBuffer{ current_style: style(), default_style: style(), height: non_neg_integer(), style_map: %{required(position()) => style()}, width: non_neg_integer() }
Functions
@spec apply_style_to_region( t(), style(), {non_neg_integer(), non_neg_integer()}, {non_neg_integer(), non_neg_integer()} ) :: t()
Applies a style to a rectangular region.
Gets the default style.
Gets the current style.
@spec get_style_at(t(), non_neg_integer(), non_neg_integer()) :: style()
Gets the style at a specific position (x, y). Returns the style at the position or the current style if not set.
Merges two styles.
@spec new(non_neg_integer(), non_neg_integer()) :: t()
Creates a new style buffer with the given dimensions.
Resets the style to default.
Sets text attributes (list of atoms).
Sets the background color.
Sets the default style.
Sets the foreground color.
Validates a style map.