author | František Kučera <franta-hg@frantovo.cz> |
Sun, 03 May 2015 02:03:03 +0200 | |
changeset 1 | 56ae7ed48121 |
child 3 | a6b5eb87350b |
permissions | -rw-r--r-- |
1 #ifndef COLORZ_H
2 #define COLORZ_H
4 #include <ostream>
5 namespace info {
6 namespace globalCode {
7 namespace parameterLister {
8 namespace terminalCodes {
10 enum Code {
11 FG_RED = 31,
12 FG_GREEN = 32,
13 FG_BLUE = 34,
14 FG_DEFAULT = 39,
15 BG_RED = 41,
16 BG_GREEN = 42,
17 BG_BLUE = 44,
18 BG_DEFAULT = 49
19 };
21 class Modifier {
22 Code code;
23 public:
25 Modifier(Code code) : code(code) {
26 }
28 friend std::ostream&
29 operator<<(std::ostream& os, const Modifier& mod) {
30 return os << "\033[" << mod.code << "m";
31 }
32 };
33 }
34 }
35 }
36 }
38 #endif /* COLORZ_H */