Skip to content
Welcome to the new CppUtils documentation!

Namespace: CppUtils::Terminal::Ansi

std::string formatSGR(const std::formattable<char> auto& code);

Formats an ANSI Select Graphic Rendition (SGR) escape sequence: \x1B[<code\>m.

See also: Select_Graphic_Rendition

ParameterDescription
codeThe SGR parameter code (e.g. 0 for reset, 1 for bold, 31 for red, “38;2;r;g;b” for truecolor).

Returns: The formatted ANSI escape string.