#include <ostream>
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<int>(code) << "m";
}
}
#include <iostream>
using namespace std;
int main() {
cout << "This ->" << Color::FG_RED << "word"
<< Color::FG_DEFAULT << "<- is red." << endl;
}