Raxol.Terminal.ANSI.Colors (Raxol v0.5.0)

View Source

Provides ANSI color functionality for terminal output. Handles color parsing, setting, and management for terminal text.

Summary

Functions

Parses a color specification into a standardized format. Accepts named colors, RGB values, and ANSI color codes.

Sets the background color.

Sets a color for the given type (foreground/background) and mode.

Sets the foreground color.

Sets the highlight background color.

Sets the highlight cursor color.

Sets the highlight foreground color.

Sets the highlight mouse background color.

Sets the highlight mouse foreground color.

Sets the mouse background color.

Sets the mouse foreground color.

Types

color()

@type color() :: :black | :red | :green | :yellow | :blue | :magenta | :cyan | :white

color_mode()

@type color_mode() :: :normal | :bright | :dim

rgb()

@type rgb() :: {0..255, 0..255, 0..255}

Functions

parse_color(color)

Parses a color specification into a standardized format. Accepts named colors, RGB values, and ANSI color codes.

set_background(color, mode \\ :normal)

Sets the background color.

set_color(type, color, mode \\ :normal)

Sets a color for the given type (foreground/background) and mode.

set_cursor_color(color, mode \\ :normal)

Sets the cursor color.

set_foreground(color, mode \\ :normal)

Sets the foreground color.

set_highlight_background(color, mode \\ :normal)

Sets the highlight background color.

set_highlight_cursor(color, mode \\ :normal)

Sets the highlight cursor color.

set_highlight_foreground(color, mode \\ :normal)

Sets the highlight foreground color.

set_highlight_mouse_background(color, mode \\ :normal)

Sets the highlight mouse background color.

set_highlight_mouse_foreground(color, mode \\ :normal)

Sets the highlight mouse foreground color.

set_mouse_background(color, mode \\ :normal)

Sets the mouse background color.

set_mouse_foreground(color, mode \\ :normal)

Sets the mouse foreground color.