Sign in to follow this  
Darkfox

Coloured Text

Recommended Posts

Pipo DeClown    804
You should figure this out!

Basically, you get the StandardOutputHandle.. - Wait, what language are you using? - and change the settings of that handle.

// Get handle
HANDLE outputHandle = GetStdHandle( STD_OUTPUT_HANDLE );
// Set color
SetConsoleTextAttribute( outputHandle, FOREGROUND_BLUE );

// Complete list of colours..
// ..here!

Share this post


Link to post
Share on other sites
Sadness    172
And which console specificaly ? A Dos Prompt console don't need the same thing to have text color compared to a linux term (Whatever term flavor you use)

But you can look at the ncurses library, they have color management for text (and background text and that kind of thing). I don't remember if it is platform independant. If not there's pcurses I think (My memory is not very good at 5:30am;))

Just take a look in google.

Karl.

Share this post


Link to post
Share on other sites
Pipo DeClown    804
Quote:
Original post by Darkfox
Thanks. I'm using C++ by the way. Also, what are the different colours like in your example 'FOREGROUND_BLUE'?

View the '// .. here!'-link at the end of my last post. ;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this