Shamrock 2025.10.0
Astrophysical Code
Loading...
Searching...
No Matches
term_colors.hpp
Go to the documentation of this file.
1// -------------------------------------------------------//
2//
3// SHAMROCK code for hydrodynamics
4// Copyright (c) 2021-2026 Timothée David--Cléris <tim.shamrock@proton.me>
5// SPDX-License-Identifier: CeCILL Free Software License Agreement v2.1
6// Shamrock is licensed under the CeCILL 2.1 License, see LICENSE for more information
7//
8// -------------------------------------------------------//
9
10#pragma once
11
18
19#include "sham/term/color.hpp"
20#include <string>
21namespace shambase {
22
23 namespace term_colors {
24
27
30
33
35 inline const std::string empty() { return ""; };
37 inline const std::string reset() { return sham::term::style::reset(); };
39 inline const std::string bold() { return sham::term::style::bold(); };
41 inline const std::string faint() { return sham::term::style::faint(); };
43 inline const std::string underline() { return sham::term::style::underline(); };
45 inline const std::string blink() { return sham::term::style::blink(); };
47 inline const std::string col8b_black() { return sham::term::colors_8b::black(); };
49 inline const std::string col8b_red() { return sham::term::colors_8b::red(); };
51 inline const std::string col8b_green() { return sham::term::colors_8b::green(); };
53 inline const std::string col8b_yellow() { return sham::term::colors_8b::yellow(); };
55 inline const std::string col8b_blue() { return sham::term::colors_8b::blue(); };
57 inline const std::string col8b_magenta() { return sham::term::colors_8b::magenta(); };
59 inline const std::string col8b_cyan() { return sham::term::colors_8b::cyan(); };
61 inline const std::string col8b_white() { return sham::term::colors_8b::white(); };
62
63 } // namespace term_colors
64
65} // namespace shambase
Terminal color escape sequences and enable/disable control.
void enable_colors()
Enable terminal color output.
Definition color.cpp:62
void disable_colors()
Disable all terminal color output.
Definition color.cpp:65
bool are_colors_enabled()
Query whether terminal color output is currently enabled.
Definition color.cpp:68
const char * red()
Escape sequence to set red text color.
Definition color.cpp:52
const char * green()
Escape sequence to set green text color.
Definition color.cpp:53
const char * black()
Escape sequence to set black text color.
Definition color.cpp:51
const char * white()
Escape sequence to set white text color.
Definition color.cpp:58
const char * magenta()
Escape sequence to set magenta (pink) text color.
Definition color.cpp:56
const char * cyan()
Escape sequence to set cyan text color.
Definition color.cpp:57
const char * blue()
Escape sequence to set blue text color.
Definition color.cpp:55
const char * yellow()
Escape sequence to set yellow text color.
Definition color.cpp:54
const char * blink()
escape sequence to set blinking text formatting.
Definition color.cpp:47
const char * reset()
escape sequence to reset the terminal text formatting.
Definition color.cpp:43
const char * bold()
escape sequence to set bold text formatting.
Definition color.cpp:44
const char * underline()
escape sequence to set underlined text formatting.
Definition color.cpp:46
const char * faint()
escape sequence to set faint (dim) text formatting.
Definition color.cpp:45
namespace for basic c++ utilities
const std::string reset()
Get the reset terminal escape char.
const std::string col8b_yellow()
Get the yellow terminal escape char.
const std::string col8b_white()
Get the white terminal escape char.
const std::string col8b_magenta()
Get the magenta (pink) terminal escape char.
const std::string empty()
Get the empty terminal escape.
const std::string blink()
Get the blink terminal escape char.
const std::string col8b_green()
Get the green terminal escape char.
const std::string col8b_blue()
Get the blue terminal escape char.
const std::string col8b_black()
Get the black terminal escape char.
const std::string underline()
Get the underline terminal escape char.
bool colors_enabled()
Are colors enabled.
void disable_colors()
Disable all colors.
void enable_colors()
Enable colors in logs.
const std::string col8b_cyan()
Get the cyan terminal escape char.
const std::string faint()
Get the faint terminal escape char.
const std::string bold()
Get the bold terminal escape char.
const std::string col8b_red()
Get the red terminal escape char.