Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
sham::term::colors_256 Namespace Reference

256-color palette escape sequences (\x1b[38;5;Nm / \x1b[48;5;Nm). More...

Functions

std::string foreground (std::uint8_t index)
 Escape sequence to set the given palette index as foreground text color.
std::string background (std::uint8_t index)
 Escape sequence to set the given palette index as background color.

Detailed Description

256-color palette escape sequences (\x1b[38;5;Nm / \x1b[48;5;Nm).

These are only emitted if colors are enabled (see enable_colors/disable_colors) and color_level() is at least ColorLevel::ANSI256; otherwise an empty string is returned.

Function Documentation

◆ background()

std::string sham::term::colors_256::background ( std::uint8_t index)

Escape sequence to set the given palette index as background color.

Definition at line 91 of file color.cpp.

◆ foreground()

std::string sham::term::colors_256::foreground ( std::uint8_t index)

Escape sequence to set the given palette index as foreground text color.

Definition at line 90 of file color.cpp.