|
static void | get_terminal_size (int &width, int &height) |
| Gets the current terminal size (width and height).
|
|
static void | exposeToLua (sol::state &lua) |
| Expose CLR constants and helper functions to a Lua state.
|
|
|
Functions for generating ANSI escape sequences for terminal formatting.
|
static const std::string | fg (Byte color) |
| Returns ANSI escape sequence to set 8-bit foreground color.
|
|
static const std::string | bg (Byte color) |
| Returns ANSI escape sequence to set 8-bit background color.
|
|
static const std::string | fg_rgb (Byte r, Byte g, Byte b) |
| Returns ANSI escape sequence to set 24-bit (RGB) foreground color.
|
|
static const std::string | fg_color (Byte clr) |
| Map a single 8-bit index into an RGB color using the bit-pattern {r:3,g:3,b:2} and return the corresponding ANSI 24-bit foreground escape sequence.
|
|
static const std::string | bg_color (Byte clr) |
| Map a single 8-bit index into an RGB color using the bit-pattern {r:3,g:3,b:2} and return the corresponding ANSI 24-bit background escape sequence.
|
|
static const std::string | bg_rgb (Byte r, Byte g, Byte b) |
| Returns ANSI escape sequence to set 24-bit (RGB) background color.
|
|
static const std::string | set_cursor_pos (Byte row=1, Byte col=1) |
| Returns ANSI escape sequence to move the cursor to a specific position.
|
|
static const std::string | save_cursor () |
| Returns ANSI escape sequence to save the current cursor position.
|
|
static const std::string | restore_cursor () |
| Returns ANSI escape sequence to restore a previously saved cursor position.
|
|
static void | write_at (Byte row, Byte col, const std::string &s) |
| Fast helper to write a string at a given terminal position.
|
|
static bool | draw_debug_text (const std::string &text, int x, int y, int ptsize=12, Uint8 r=255, Uint8 g=255, Uint8 b=255, Uint8 a=255) |
|
static bool | get_cursor_pos (int &row, int &col) |
| Query the terminal for the current cursor position (row, col).
|
|
static const std::string | erase_in_display (Byte n=0) |
| Returns ANSI escape sequence to clear part of the screen.
|
|
static const std::string | erase_in_line (Byte n=0) |
| Returns ANSI escape sequence to erase part of the current line.
|
|
|
Utility functions for indentation, hex formatting, and padding.
|
static std::string | indent_push () |
| Increases indentation level and returns corresponding spaces.
|
|
static std::string | indent_pop () |
| Decreases indentation level and returns corresponding spaces.
|
|
static std::string | indent () |
| Returns spaces for the current indentation level.
|
|
static std::string | hex (Uint32 n, Uint8 d) |
| Converts an integer to a zero-padded hexadecimal string.
|
|
static std::string | pad (std::string text, Uint8 d) |
| Pads a string with spaces to a specified length.
|
|
|
|
ANSI escape sequences for text formatting attributes.
|
static const std::string | RESET = "\e[0m" |
| ANSI escape sequence to reset formatting.
|
|
static const std::string | NORMAL = "\e[0m" |
| ANSI escape sequence to reset all attributes.
|
|
static const std::string | RETURN = "\e[0m\n" |
| ANSI escape sequence to reset all attributes and add a newline.
|
|
static const std::string | BOLD = "\e[1m" |
| ANSI escape sequence to set bold text.
|
|
static const std::string | DIM = "\e[2m" |
| ANSI escape sequence to set dim text.
|
|
static const std::string | ITALIC = "\e[3m" |
| ANSI escape sequence to set italic text.
|
|
static const std::string | UNDERLINE = "\e[4m" |
| ANSI escape sequence to set underline text.
|
|
static const std::string | BLINKING = "\e[5m" |
| ANSI escape sequence to set blinking text.
|
|
static const std::string | REVERSED = "\e[7m" |
| ANSI escape sequence to set reversed text.
|
|
static const std::string | CONCEALED = "\e[8m" |
| ANSI escape sequence to set concealed text.
|
|
static const std::string | STRIKE = "\e[9m" |
| ANSI escape sequence to set strikethrough text.
|
|
static const std::string | ERASE_LINE = "\e[2K\r" |
| ANSI escape sequence to erase the entire current line and return cursor to start of line.
|
|
|
ANSI escape sequences for foreground text colors.
|
static const std::string | BLACK = "\e[0;30m" |
| ANSI escape sequence for black foreground.
|
|
static const std::string | RED = "\e[0;31m" |
| ANSI escape sequence for red foreground.
|
|
static const std::string | GREEN = "\e[0;32m" |
| ANSI escape sequence for green foreground.
|
|
static const std::string | BROWN = "\e[0;33m" |
| ANSI escape sequence for brown foreground.
|
|
static const std::string | BLUE = "\e[0;34m" |
| ANSI escape sequence for blue foreground.
|
|
static const std::string | PURPLE = "\e[0;35m" |
| ANSI escape sequence for purple foreground.
|
|
static const std::string | MAGENTA = "\e[0;35m" |
| ANSI escape sequence for magenta foreground.
|
|
static const std::string | CYAN = "\e[0;36m" |
| ANSI escape sequence for cyan foreground.
|
|
static const std::string | GREY = "\e[0;37m" |
| ANSI escape sequence for grey foreground.
|
|
static const std::string | DARK = "\e[1;30m" |
| ANSI escape sequence for dark grey foreground.
|
|
static const std::string | ORANGE = "\e[1;31m" |
| ANSI escape sequence for orange foreground.
|
|
static const std::string | LT_GRN = "\e[1;32m" |
| ANSI escape sequence for light green foreground.
|
|
static const std::string | YELLOW = "\e[1;33m" |
| ANSI escape sequence for yellow foreground.
|
|
static const std::string | LT_BLUE = "\e[1;34m" |
| ANSI escape sequence for light blue foreground.
|
|
static const std::string | PINK = "\e[1;35m" |
| ANSI escape sequence for pink foreground.
|
|
static const std::string | LT_CYAN = "\e[1;36m" |
| ANSI escape sequence for light cyan foreground.
|
|
static const std::string | WHITE = "\e[1;37m" |
| ANSI escape sequence for white foreground.
|
|
static const std::string | LT_MAGENTA = fg_rgb(255, 105, 180) |
| ANSI escape sequence for light magenta (hot pink) foreground.
|
|
static const std::string | LT_ORANGE = fg_rgb(255, 165, 79) |
| ANSI escape sequence for light orange foreground.
|
|
|
ANSI escape sequences for background text colors.
|
static const std::string | BG_BLACK = "\e[0;40m" |
| ANSI escape sequence for black background.
|
|
static const std::string | BG_RED = "\e[0;41m" |
| ANSI escape sequence for red background.
|
|
static const std::string | BG_GREEN = "\e[0;42m" |
| ANSI escape sequence for green background.
|
|
static const std::string | BG_BROWN = "\e[0;43m" |
| ANSI escape sequence for brown background.
|
|
static const std::string | BG_BLUE = "\e[0;44m" |
| ANSI escape sequence for blue background.
|
|
static const std::string | BG_PURPLE = "\e[0;45m" |
| ANSI escape sequence for purple background.
|
|
static const std::string | BG_CYAN = "\e[0;46m" |
| ANSI escape sequence for cyan background.
|
|
static const std::string | BG_GREY = "\e[0;47m" |
| ANSI escape sequence for grey background.
|
|
static const std::string | BG_DEFAULT = "\e[0;49m" |
| ANSI escape sequence for default background.
|
|
static const std::string | BG_DARK = "\e[0;100m" |
| ANSI escape sequence for dark grey background.
|
|
static const std::string | BG_LT_RED = "\e[0;101m" |
| ANSI escape sequence for light red background.
|
|
static const std::string | BG_LT_GREEN = "\e[0;102m" |
| ANSI escape sequence for light green background.
|
|
static const std::string | BG_YELLOW = "\e[0;103m" |
| ANSI escape sequence for yellow background.
|
|
static const std::string | BG_LT_BLUE = "\e[0;104m" |
| ANSI escape sequence for light blue background.
|
|
static const std::string | BG_PINK = "\e[0;105m" |
| ANSI escape sequence for pink background.
|
|
static const std::string | BG_LT_CYAN = "\e[0;106m" |
| ANSI escape sequence for light cyan background.
|
|
static const std::string | BG_WHITE = "\e[0;107m" |
| ANSI escape sequence for white background.
|
|
Static container for ANSI escape sequences and formatting helpers.
Provides color and formatting utilities for terminal output. Cannot be instantiated. All members are static. See individual groups for details.