Following colors are available for use in C graphics programming.
Colors table
Color | Value |
BLACK | 0 |
BLUE | 1 |
GREEN | 2 |
CYAN | 3 |
RED | 4 |
MAGENTA | 5 |
BROWN | 6 |
LIGHTGRAY | 7 |
DARKGRAY | 8 |
LIGHTBLUE | 9 |
LIGHTGREEN | 10 |
LIGHTCYAN | 11 |
LIGHTRED | 12 |
LIGHTMAGENTA | 13 |
YELLOW | 14 |
WHITE | 15 |
Total number of colors available depend on current graphics driver and mode. Use colors name in capital letters, for example,use setcolor(RED) not setcolor(red) the latter will give you an error. You may use number instead of color for example,setbkcolor(GREEN) or setbkcolor(2) are same, but you are advised to use color name as it will improve readability of program.