For all of you out there that are trying to change the Text color and or the background color and you want to use a simple code use the SetConsoleTextAttribute command. I spent a long time looking online for someone that had a list of all the numbers and the color they corresponded with. So her is a simple program that will print out all 256 color combinations and the corresponding number of that color combination. Just copy and paste and it should work I am also giving you a screen shot of the final product. Good luck!
Code:#include <stdio.h> #include <windows.h> int main () { int count; HANDLE hConsole; hConsole = GetStdHandle(STD_OUTPUT_HANDLE); for (count=0; count<257; count++) { SetConsoleTextAttribute(hConsole, count); printf ("This color combination has the number of %i\n",count); } SetConsoleTextAttribute(hConsole, 7); system ("pause"); return 0; }



1Likes
LinkBack URL
About LinkBacks



