View Full Version : Xcode C++ help! Changing text color
unknown.exe
Dec 1, 2007, 10:21 AM
Sup, I need a way to change the text color in my Xcode C++ prog... i'm pretty sure you can't do it but if there is a way can some one tell me?
PS... Ive already tried setcolor and textcolor and they dont work even w/ conio.h...:apple:
Krevnik
Dec 1, 2007, 01:49 PM
If you are using the command-line, you can print the ANSI color codes directly into your text stream.
unknown.exe
Dec 1, 2007, 01:52 PM
If you are using the command-line, you can print the ANSI color codes directly into your text stream.
explain?
unknown.exe
Dec 1, 2007, 01:57 PM
its not from the command line, it's from xcode
Krevnik
Dec 1, 2007, 02:03 PM
its not from the command line, it's from xcode
But you are trying to set text color via conio.h, which means your app is a command-line app, right?
If you run the command-line app via XCode, it won't show any color, it will only show color when running the application via the Terminal.
unknown.exe
Dec 1, 2007, 03:54 PM
ok... but how do I use the codes? Example please?
Krevnik
Dec 1, 2007, 10:52 PM
Lookup ANSI Color codes, pages like this one explain how they work.
http://pueblo.sourceforge.net/doc/manual/ansi_color_codes.html
You just need to add the characters into the text string that you write out to the console, and it will change the colors of the text written after it.
However, again, this only works from the Terminal.
vBulletin® v3.8.6, Copyright ©2000-2012, Jelsoft Enterprises Ltd.