Hi,
I am looking for the system function to adjust background color. It was like
system("color",somecolorcodes);
Does anyone know about it?
On Windows Xp or 7!
Hi,
I am looking for the system function to adjust background color. It was like
system("color",somecolorcodes);
Does anyone know about it?
On Windows Xp or 7!
It's "color XX" where the first X is the background and the second X is the foreground.
The codes are as following:
0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White
So basically for black text on white ground, you do
system("color 70");
Windows only, tho.
You can use the SetConsoleTextAttribute function in Windows. This will let you output text in different colors at the same time, while calling "color" doesn't.
There are also others that are less coarse -- search for color in this listing of console functions.
Also, if you're looking for a cross-platform approach take a look, for instance, at this file from Musepack.