16namespace rush::color {
56enum class Style : std::uint8_t {
68constexpr char reset[] =
"\033[0m";
69constexpr char endl[] =
"\033[0m\n";
77using checkType = std::enable_if_t<std::is_same_v<T, Style> || std::is_same_v<T, Foreground> || std::is_same_v<T, Background>, std::ostream &>;
79inline std::string escape_sequence(
int x) {
80 return static_cast<std::string
>(
"\033[") + std::to_string(x) +
static_cast<std::string
>(
"m");
95checkType<T> operator<<(std::ostream &os,
const T x) {
96 os << escape_sequence(static_cast<int>(x));
Background
Stream buffer background color.
Definition color.hpp:40
constexpr char endl[]
Definition color.hpp:69
Style
Stream buffer style.
Definition color.hpp:56
constexpr char reset[]
Definition color.hpp:68
Foreground
Stream buffer foreground color.
Definition color.hpp:23