RUSH
Reusable Utilities in Single Headers is a collection of header-only utilities for C++
|
This library provides text color and style formating utilities. More...
#include <cstdint>
#include <ostream>
#include <string>
#include <type_traits>
Go to the source code of this file.
Typedefs | |
using | rush::color::fg = Foreground |
using | rush::color::bg = Background |
using | rush::color::st = Style |
Enumerations | |
enum class | rush::color::Foreground : std::uint8_t { black = 30 , red , green , yellow , blue , magenta , cyan , gray , white = 0 } |
Stream buffer foreground color. More... | |
enum class | rush::color::Background : std::uint8_t { black = 40 , red , green , yellow , blue , magenta , cyan , gray } |
Stream buffer background color. More... | |
enum class | rush::color::Style : std::uint8_t { bold = 1 , dim , italic , underline , blink , rblink , reversed , conceal , crossed } |
Stream buffer style. More... | |
Functions | |
template<typename T > | |
checkType< T > | rush::color::operator<< (std::ostream &os, const T x) |
Stream insertion operator for applying styles and colors. | |
Variables | |
constexpr char | rush::color::reset [] = "\033[0m" |
constexpr char | rush::color::endl [] = "\033[0m\n" |
This library provides text color and style formating utilities.
using rush::color::bg = Background |
Alias for Background
using rush::color::fg = Foreground |
Alias for Foreground
using rush::color::st = Style |
Alias for Style
|
strong |
Stream buffer background color.
This enumeration defines various background colors that can be applied to text in console output.
|
strong |
Stream buffer foreground color.
This enumeration defines various foreground colors that can be applied to text in console output.
|
strong |
Stream buffer style.
This enumeration defines various text styles that can be applied to text in console output.
checkType< T > rush::color::operator<< | ( | std::ostream & | os, |
const T | x ) |
Stream insertion operator for applying styles and colors.
This operator allows applying styles and colors to an output stream using the defined enumerations.
T | The type of the style or color. |
os | The output stream. |
x | The style or color to apply. |
|
constexpr |
Escape sequence to reset text formatting and add a newline
|
constexpr |
Escape sequence to reset text formatting