You are here

colors in C graphics

Following colors are available for use in C graphics programming.

Colors table

ColorValue
BLACK0
BLUE1
GREEN2
CYAN3
RED4
MAGENTA5
BROWN6
LIGHTGRAY7
DARKGRAY8
LIGHTBLUE9
LIGHTGREEN10
LIGHTCYAN11
LIGHTRED12
LIGHTMAGENTA13
YELLOW14
WHITE15

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.