Raxol.Core.Renderer.Color (Raxol v0.4.0)
View SourceProvides comprehensive color support for terminal rendering.
Supports:
- ANSI 16 colors (4-bit)
- ANSI 256 colors (8-bit)
- True Color (24-bit)
- Color themes
- Terminal background detection
Summary
Functions
Creates a color theme map.
Returns the default color theme.
Detects the terminal's background color. Returns :light or :dark.
Converts a hex color string to RGB.
Converts RGB values to the nearest ANSI 256 color code.
Converts a color representation to its ANSI foreground escape code.
Converts a color representation to its ANSI background escape code.
Types
@type ansi_16() ::
:black
| :red
| :green
| :yellow
| :blue
| :magenta
| :cyan
| :white
| :bright_black
| :bright_red
| :bright_green
| :bright_yellow
| :bright_blue
| :bright_magenta
| :bright_cyan
| :bright_white
@type ansi_256() :: 0..255
@type color() :: ansi_16() | ansi_256() | true_color()
@type true_color() :: {0..255, 0..255, 0..255}
Functions
Creates a color theme map.
Returns the default color theme.
Detects the terminal's background color. Returns :light or :dark.
Converts a hex color string to RGB.
Converts RGB values to the nearest ANSI 256 color code.
Converts a color representation to its ANSI foreground escape code.
Converts a color representation to its ANSI background escape code.