0

Hi, I have absolutely no clue how to implement Ascii color into a console program. I have tried google, but it only finds irrelevant things...


~thanks!!!!!~

Kodiak!!!

3
Contributors
3
Replies
5
Views
10 Years
Discussion Span
Last Post by spider_pig
0

OOPS!!

Sorry guys... I should probabaly include that my compiler is dev c++ version 4.9.9.2,

Plus, are there any libraries out there that do this??

0

If you put

void setcolor(unsigned short color)                
{                                                   
    HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hcon,color);
}

this before the main process you can call the setcolor function before you print to the screen using numbers 0 to 15 as parameters eg

setcolor(3);
cout << "I'm blue";

Experiment and see what colors you get, 0 is black so you might not see anything!

This topic has been dead for over six months. 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.