Raxol.Terminal.FormattingManager (Raxol v0.5.0)

View Source

Manages the terminal text formatting.

Summary

Functions

Checks if the given attribute is set in the style.

Gets the background color from the style.

Gets the foreground color from the style.

Gets the set attributes from the style.

Gets the current style.

Resets all attributes in the style.

Resets the given attribute in the style.

Sets the given attribute in the style.

Sets the background color in the style.

Sets the foreground color in the style.

Updates the style.

Types

t()

@type t() :: %Raxol.Terminal.FormattingManager{style: map()}

Functions

attribute_set?(state, attribute)

@spec attribute_set?(t(), atom()) :: boolean()

Checks if the given attribute is set in the style.

get_background(state)

@spec get_background(t()) :: atom()

Gets the background color from the style.

get_foreground(state)

@spec get_foreground(t()) :: atom()

Gets the foreground color from the style.

get_set_attributes(state)

@spec get_set_attributes(t()) :: list()

Gets the set attributes from the style.

get_style(state)

@spec get_style(t()) :: map()

Gets the current style.

reset_all_attributes(state)

@spec reset_all_attributes(t()) :: t()

Resets all attributes in the style.

reset_attribute(state, attribute)

@spec reset_attribute(t(), atom()) :: t()

Resets the given attribute in the style.

set_attribute(state, attribute)

@spec set_attribute(t(), atom()) :: t()

Sets the given attribute in the style.

set_background(state, color)

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

Sets the background color in the style.

set_foreground(state, color)

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

Sets the foreground color in the style.

update_style(state, style)

@spec update_style(t(), map()) :: t()

Updates the style.