LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Changing the colour of text (https://www.linuxquestions.org/questions/programming-9/changing-the-colour-of-text-180508/)

kamransoomro84 05-11-2004 08:44 PM

Changing the colour of text
 
Hi. I was just wondering how I could change the colour of output text in a program in C++. Not using ncurses winows of course. Thanks.

itsme86 05-12-2004 08:57 AM

You can print the ANSI code for the color.

printf("\033[34;1mBright Blue\033[37;0m\n");

That will change the color to bright blue and then back to white.

Here's a really good site that talks about all of the ANSI codes and lists which numbers are for which color, etc.:

http://www.fh-jena.de/~gmueller/Kurs...esc_vt100.html


All times are GMT -5. The time now is 01:22 AM.