You are here

getcolor function

getcolor function returns the current drawing color.

Declaration : int getcolor();

e.g. a = getcolor(); // a is an integer variable
if current drawing color is WHITE then a will be 15.
See colors in C graphics.

C programming code for getcolor


   int gd = DETECT, gm, drawing_color;
   char a[100];

   drawing_color = getcolor();

   sprintf(a,"Current drawing color = %d", drawing_color);
   outtextxy( 10, 10, a );

   return 0;