In graphics mode, you can specify a color by name, as in: setcolor(RED) or setcolor (GREEN), but there are actually 64 colors which you can use. Most of them don't have a corresponding name. Just use the number, like setcolor(43) or setcolor(12). Here's a picture of the available colors:
By the way, here's the code that made the above code:
// // Project Name: All the Colors // // Author: Matthew Weathers // Date : 10-Sept-2001 #include <stdlib.h> #include <stdio.h> #include <math.h> #include <time.h> #include <string.h> #include "graphics2.h" #define ESC 0x1b void main() { srand(time(NULL)); // Seed the random number generator int GraphDriver=0,GraphMode=0; initgraph( &GraphDriver, &GraphMode, "", 640, 480 ); // Start Window char tempstring[80]; int i,j,color; for(i=0;i<=7;i++) { for (j=0;j<=8;j++) { color =i*8+j; setcolor(color); setfillstyle(SOLID_FILL,color); sprintf(tempstring,"%d",color); bar (50+40*i,50+40*j, 80+40*i, 80+40*j); setcolor(WHITE); outtextxy(50+40*i,50+40*j,tempstring); } } getch(); //Wait for a key. (When main function ends, the window will close) } //end of main()