Here's an old post about that last method that gives the color value macros. The foreground and background each have a red, green, blue, and intensity bit, you OR those together to create the various color combinations.
Specifies the foreground and background color attributes. Any combination of the following values can be specified: FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_RED, FOREGROUND_INTENSITY, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_RED, and BACKGROUND_INTENSITY. For example, the following combination of values produces white text on a black background:
include <windows.h> in headers.int color can be 0 to 255,make a loop and call Colors(loop) and cout <<"Hello World"<<endl; or something to view all the colors.Makes for a right purdy display.also cout the loop counter to see what number goes along with what color.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How can one change the displayed text color?
try google.com and look up the word "crayola"
If you're talking about the color that the code appears when you're writing it -
Tools -> Compiler Options (or the 3rd one down) -> Syntax tab -> go from there.
If for the console, check out windows.h and conio.
I think I knew what you meen, loogk at
http://www.daniweb.com/code/snippet83.html
Payne Diaz
if you're using windows and don't mind using system commands:
system("color &%");
& and % are numbers/letters: 0 - 9, A - F, the first is the background, the second is text colour...
just experiment and see what you get...
Here's an old post about that last method that gives the color value macros. The foreground and background each have a red, green, blue, and intensity bit, you OR those together to create the various color combinations.
http://sourceforge.net/forum/message.php?msg_id=2424480
From ye ol' documentation:
wAttributes
Specifies the foreground and background color attributes. Any combination of the following values can be specified: FOREGROUND_BLUE, FOREGROUND_GREEN, FOREGROUND_RED, FOREGROUND_INTENSITY, BACKGROUND_BLUE, BACKGROUND_GREEN, BACKGROUND_RED, and BACKGROUND_INTENSITY. For example, the following combination of values produces white text on a black background:
FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE
Kip
simply tell it to change the color.
You gave me no idea as to what you are talking about, so I can only return the same kind of answer.
change the text color of what? the Dev C editor, a console program, windows gui program, the word "STOP" on the local stop sign down the street?
Read the FAQ's before posting again please.
Or get Hongli Lai's CONIO for Dev-C++/MinGW (http://conio.sf.net/, or by the WebUpdate Module).
> Or get Hongli Lai's CONIO for Dev-C++/MinGW (http://conio.sf.net/, or by the WebUpdate Module).
Hongli Lai is not a developer of this project
http://sourceforge.net/projects/conio/
void Colors(int color)//7=normal,12=red
{
HANDLE hCon=GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleTextAttribute(hCon,color);
}
include <windows.h> in headers.int color can be 0 to 255,make a loop and call Colors(loop) and cout <<"Hello World"<<endl; or something to view all the colors.Makes for a right purdy display.also cout the loop counter to see what number goes along with what color.