I found an old post (2002) on another website where someone asked how to colorize text in Linux. The reply was:

printf ("\033[31ma\033[32mb\n");

Where the format is "\033[XXm" followed by the text to be colored. I tried this on my Ubunutu machine and it works. It even works with "cout <<". So that brings a couple of questions.

1) Is this platform independent? I threw Windoze out a long time ago, so I don't have anything else to test it on.

2) Where can I find a list of color codes. I don't even know what to google. What would you call that?

Or if anyone has a better solution for colored text, I'm wide open to suggestions.

5 Years
Discussion Span
Last Post by txwooley

Google? Damn! I wish I'd have thought of that!!! Please read the second question in it's entirety.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.