#include namespace Color { enum Code { FG_RED = 31, FG_GREEN = 32, FG_BLUE = 34, FG_DEFAULT = 39, BG_RED = 41, BG_GREEN = 42, BG_BLUE = 44, BG_DEFAULT = 49 }; std::ostream& operator<<(std::ostream& os, Code code) { return os << "\033[" << static_cast(code) << "m"; } } #include using namespace std; int main() { cout << "This ->" << Color::FG_RED << "word" << Color::FG_DEFAULT << "<- is red." << endl; }