How to enable rgb colored output in terminal?
- by t.pimentel
I'm trying to print a colored string to a gnome-terminal using ANSI escape codes, but, although it works for the custom colors, or even the 256 extra color, it doesn't work with RGB codes.
So, simplifying:
cout << "\033[33m" << '.' << "\033[0m"; # prints with color
cout << "\033[38;5;135m" << '.' << "\033[0m"; # prints with color
cout << "\033[38;2;0;135;0m" << '.' << "\033[0m"; # doesn't work, prints with default color
How can I output something with an RGB color code in the gnome-terminal?
I'm following this link for outputs: Wikipedia ANSI escape code.