~
[scx.git] / include / ColStr.hpp
blobd52f9815316caefb6b7ec43cdf3bad24fb2b73ca
1 #ifndef SCX_COLSTRSTRING_H
2 #define SCX_COLSTRSTRING_H
4 #include <string>
5 using namespace std;
7 #define SCX_COLSTR_RED0 "\e[0;31m"
8 #define SCX_COLSTR_RED1 "\e[1;31m"
9 #define SCX_COLSTR_BLUE0 "\e[0;34m"
10 #define SCX_COLSTR_BLUE1 "\e[1;34m"
11 #define SCX_COLSTR_CYAN0 "\e[0;36m"
12 #define SCX_COLSTR_CYAN1 "\e[1;36m"
13 #define SCX_COLSTR_GREEN0 "\e[0;32m"
14 #define SCX_COLSTR_GREEN1 "\e[1;32m"
15 #define SCX_COLSTR_YELLOW0 "\e[0;33m"
16 #define SCX_COLSTR_YELLOW1 "\e[1;33m"
17 #define SCX_COLSTR_NC "\e[0m"
19 namespace scx {
21 static inline string RedStr(const string& str, bool front = true)
23 return (front ? SCX_COLSTR_RED1 : SCX_COLSTR_RED0) +
24 str + SCX_COLSTR_NC;
27 static inline string BlueStr(const string& str, bool front = true)
29 return (front ? SCX_COLSTR_BLUE1 : SCX_COLSTR_BLUE0) +
30 str + SCX_COLSTR_NC;
33 static inline string CyanStr(const string& str, bool front = true)
35 return (front ? SCX_COLSTR_CYAN1 : SCX_COLSTR_CYAN0) +
36 str + SCX_COLSTR_NC;
39 static inline string GreenStr(const string& str, bool front = true)
41 return (front ? SCX_COLSTR_GREEN1 : SCX_COLSTR_GREEN0) +
42 str + SCX_COLSTR_NC;
45 static inline string YellowStr(const string& str, bool front = true)
47 return (front ? SCX_COLSTR_YELLOW1 : SCX_COLSTR_YELLOW0) +
48 str + SCX_COLSTR_NC;
52 #endif