Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
color.cpp File Reference

Terminal color escape sequence constants and enable/disable control implementation. More...

Include dependency graph for color.cpp:

Go to the source code of this file.

Namespaces

namespace  sham
 namespace for backends this one is named only sham since shambackends is too long to write
namespace  sham::term::style
 Terminal text styling escape sequences (bold, faint, underline, blink, reset).
namespace  sham::term::colors_8b
 8 bit 8-color palette escape sequences.

Macros

#define TERM_ESCAPTE_CHAR   "\x1b["

Functions

const char * sham::term::style::reset ()
 escape sequence to reset the terminal text formatting.
const char * sham::term::style::bold ()
 escape sequence to set bold text formatting.
const char * sham::term::style::faint ()
 escape sequence to set faint (dim) text formatting.
const char * sham::term::style::underline ()
 escape sequence to set underlined text formatting.
const char * sham::term::style::blink ()
 escape sequence to set blinking text formatting.
const char * sham::term::colors_8b::black ()
 Escape sequence to set black text color.
const char * sham::term::colors_8b::red ()
 Escape sequence to set red text color.
const char * sham::term::colors_8b::green ()
 Escape sequence to set green text color.
const char * sham::term::colors_8b::yellow ()
 Escape sequence to set yellow text color.
const char * sham::term::colors_8b::blue ()
 Escape sequence to set blue text color.
const char * sham::term::colors_8b::magenta ()
 Escape sequence to set magenta (pink) text color.
const char * sham::term::colors_8b::cyan ()
 Escape sequence to set cyan text color.
const char * sham::term::colors_8b::white ()
 Escape sequence to set white text color.
void sham::term::enable_colors ()
 Enable terminal color output.
void sham::term::disable_colors ()
 Disable all terminal color output.
bool sham::term::are_colors_enabled ()
 Query whether terminal color output is currently enabled.

Detailed Description

Terminal color escape sequence constants and enable/disable control implementation.

Author
Timothée David–Cléris (tim.s.nosp@m.hamr.nosp@m.ock@p.nosp@m.roto.nosp@m.n.me)

Definition in file color.cpp.

Macro Definition Documentation

◆ TERM_ESCAPTE_CHAR

#define TERM_ESCAPTE_CHAR   "\x1b["

Definition at line 19 of file color.cpp.

Function Documentation

◆ are_colors_enabled()

bool sham::term::are_colors_enabled ( )

Query whether terminal color output is currently enabled.

Are colors enabled.

Definition at line 68 of file color.cpp.

◆ disable_colors()

void sham::term::disable_colors ( )

Disable all terminal color output.

Disable all colors.

Definition at line 65 of file color.cpp.

◆ enable_colors()

void sham::term::enable_colors ( )

Enable terminal color output.

Enable colors.

Definition at line 62 of file color.cpp.