Raxol.Terminal.StyleManager (Raxol v2.0.1)
View SourceManages terminal style operations including colors, attributes, and formatting. This module is responsible for handling all style-related operations in the terminal.
Summary
Functions
Applies a style to a region. Returns the updated emulator.
Gets the style buffer instance. Returns the style buffer.
Gets the default style. Returns the default style map.
Gets the current style. Returns the current style map.
Gets the style at a specific position. Returns the style map at that position.
Merges two styles. Returns the merged style map.
Resets the style to default. Returns the updated emulator.
Sets text attributes. Returns the updated emulator.
Sets the background color. Returns the updated emulator.
Sets the default style. Returns the updated emulator.
Sets the foreground color. Returns the updated emulator.
Updates the style buffer instance. Returns the updated emulator.
Validates a style map. Returns :ok or {:error, reason}.
Functions
@spec apply_style_to_region( Raxol.Terminal.Emulator.t(), {non_neg_integer(), non_neg_integer()}, {non_neg_integer(), non_neg_integer()}, Raxol.Terminal.StyleBuffer.style() ) :: Raxol.Terminal.Emulator.t()
Applies a style to a region. Returns the updated emulator.
@spec get_buffer(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.StyleBuffer.t()
Gets the style buffer instance. Returns the style buffer.
@spec get_default_style(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.StyleBuffer.style()
Gets the default style. Returns the default style map.
@spec get_style(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.StyleBuffer.style()
Gets the current style. Returns the current style map.
@spec get_style_at(Raxol.Terminal.Emulator.t(), integer(), integer()) :: Raxol.Terminal.StyleBuffer.style()
Gets the style at a specific position. Returns the style map at that position.
@spec merge_styles( Raxol.Terminal.StyleBuffer.style(), Raxol.Terminal.StyleBuffer.style() ) :: Raxol.Terminal.StyleBuffer.style()
Merges two styles. Returns the merged style map.
@spec reset_style(Raxol.Terminal.Emulator.t()) :: Raxol.Terminal.Emulator.t()
Resets the style to default. Returns the updated emulator.
@spec set_attributes(Raxol.Terminal.Emulator.t(), [atom()]) :: Raxol.Terminal.Emulator.t()
Sets text attributes. Returns the updated emulator.
@spec set_background(Raxol.Terminal.Emulator.t(), binary()) :: Raxol.Terminal.Emulator.t()
Sets the background color. Returns the updated emulator.
@spec set_default_style( Raxol.Terminal.Emulator.t(), Raxol.Terminal.StyleBuffer.style() ) :: Raxol.Terminal.Emulator.t()
Sets the default style. Returns the updated emulator.
@spec set_foreground(Raxol.Terminal.Emulator.t(), binary()) :: Raxol.Terminal.Emulator.t()
Sets the foreground color. Returns the updated emulator.
@spec update_buffer(Raxol.Terminal.Emulator.t(), Raxol.Terminal.StyleBuffer.t()) :: Raxol.Terminal.Emulator.t()
Updates the style buffer instance. Returns the updated emulator.
@spec validate_style(Raxol.Terminal.StyleBuffer.style()) :: :ok | {:error, String.t()}
Validates a style map. Returns :ok or {:error, reason}.