You are here

setcolor function in c

Declaration: void setcolor(int color);

In Turbo Graphics each color is assigned a number. Total 16 colors are available. Strictly speaking number of available colors depends on current graphics mode and driver.For Example :- BLACK is assigned 0, RED is assigned 4 etc. setcolor function is used to change the current drawing color.e.g. setcolor(RED) or setcolor(4) changes the current drawing color to RED. Remember that default drawing color is WHITE.

C programming code for setcolor

   int gd = DETECT, gm;
   circle(100,100,50);          /* drawn in white color */ 
   circle(200,200,50);          /* drawn in red color   */
   return 0;