ZeroErr
color.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 namespace zeroerr {
6 
7 #ifdef ZEROERR_ALWAYS_COLORFUL
8 constexpr const char* Reset = "\x1b[0m";
9 constexpr const char* Bright = "\x1b[1m";
10 constexpr const char* Dim = "\x1b[2m";
11 constexpr const char* Underscore = "\x1b[4m";
12 constexpr const char* Blink = "\x1b[5m";
13 constexpr const char* Reverse = "\x1b[7m";
14 constexpr const char* Hidden = "\x1b[8m";
15 
16 constexpr const char* FgBlack = "\x1b[30m";
17 constexpr const char* FgRed = "\x1b[31m";
18 constexpr const char* FgGreen = "\x1b[32m";
19 constexpr const char* FgYellow = "\x1b[33m";
20 constexpr const char* FgBlue = "\x1b[34m";
21 constexpr const char* FgMagenta = "\x1b[35m";
22 constexpr const char* FgCyan = "\x1b[36m";
23 constexpr const char* FgWhite = "\x1b[37m";
24 
25 constexpr const char* BgBlack = "\x1b[40m";
26 constexpr const char* BgRed = "\x1b[41m";
27 constexpr const char* BgGreen = "\x1b[42m";
28 constexpr const char* BgYellow = "\x1b[43m";
29 constexpr const char* BgBlue = "\x1b[44m";
30 constexpr const char* BgMagenta = "\x1b[45m";
31 constexpr const char* BgCyan = "\x1b[46m";
32 constexpr const char* BgWhite = "\x1b[47m";
33 
34 #elif defined(ZEROERR_DISABLE_COLORFUL)
35 constexpr const char* Reset = "";
36 constexpr const char* Bright = "";
37 constexpr const char* Dim = "";
38 constexpr const char* Underscore = "";
39 constexpr const char* Blink = "";
40 constexpr const char* Reverse = "";
41 constexpr const char* Hidden = "";
42 
43 constexpr const char* FgBlack = "";
44 constexpr const char* FgRed = "";
45 constexpr const char* FgGreen = "";
46 constexpr const char* FgYellow = "";
47 constexpr const char* FgBlue = "";
48 constexpr const char* FgMagenta = "";
49 constexpr const char* FgCyan = "";
50 constexpr const char* FgWhite = "";
51 
52 constexpr const char* BgBlack = "";
53 constexpr const char* BgRed = "";
54 constexpr const char* BgGreen = "";
55 constexpr const char* BgYellow = "";
56 constexpr const char* BgBlue = "";
57 constexpr const char* BgMagenta = "";
58 constexpr const char* BgCyan = "";
59 constexpr const char* BgWhite = "";
60 #else
61 extern const char* Reset;
62 extern const char* Bright;
63 extern const char* Dim;
64 extern const char* Underscore;
65 extern const char* Blink;
66 extern const char* Reverse;
67 extern const char* Hidden;
68 
69 extern const char* FgBlack;
70 extern const char* FgRed;
71 extern const char* FgGreen;
72 extern const char* FgYellow;
73 extern const char* FgBlue;
74 extern const char* FgMagenta;
75 extern const char* FgCyan;
76 extern const char* FgWhite;
77 
78 extern const char* BgBlack;
79 extern const char* BgRed;
80 extern const char* BgGreen;
81 extern const char* BgYellow;
82 extern const char* BgBlue;
83 extern const char* BgMagenta;
84 extern const char* BgCyan;
85 extern const char* BgWhite;
86 
90 extern void disableColorOutput();
91 
95 extern void enableColorOutput();
96 
97 #endif
98 
99 } // namespace zeroerr
Definition: benchmark.cpp:17
const char * FgCyan
Definition: color.cpp:48
const char * Bright
Definition: color.cpp:35
const char * BgMagenta
Definition: color.cpp:56
void disableColorOutput()
Global function to disable colorful output.
Definition: color.cpp:62
const char * Hidden
Definition: color.cpp:40
const char * Dim
Definition: color.cpp:36
const char * FgBlue
Definition: color.cpp:46
const char * BgRed
Definition: color.cpp:52
const char * BgYellow
Definition: color.cpp:54
const char * FgMagenta
Definition: color.cpp:47
const char * BgGreen
Definition: color.cpp:53
void enableColorOutput()
Global function to enable colorful output.
Definition: color.cpp:91
const char * FgWhite
Definition: color.cpp:49
const char * FgGreen
Definition: color.cpp:44
const char * FgBlack
Definition: color.cpp:42
const char * Blink
Definition: color.cpp:38
const char * BgWhite
Definition: color.cpp:58
const char * Underscore
Definition: color.cpp:37
const char * BgBlack
Definition: color.cpp:51
const char * BgCyan
Definition: color.cpp:57
const char * FgRed
Definition: color.cpp:43
const char * Reverse
Definition: color.cpp:39
const char * BgBlue
Definition: color.cpp:55
const char * FgYellow
Definition: color.cpp:45
const char * Reset
Definition: color.cpp:34