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