pan_setcolor(PANEL*, var type, var num, COLOR*)

Changes the color of a panel element. A7.74

Parameters:

PANEL* Panel pointer.
type

Element type:
1 = digits
3 = button
4 = slider
5 = window
6 = needle

num Number of the element, starting with 1.
COLOR* BGR color vector, or NULL for using the panel's color.

Remarks:

The changed color is not saved by game_save.

Example:

// display a multicolored digital clock
function main()
{
   screen_size.x = 620;  
   screen_size.y = 200;  
   PANEL* clock = pan_create(NULL,0);
   FONT* arial100 = font_create("Arial#100bi");
   pan_setdigits(clock,0,100,50,"%02.f :", arial100, 1, sys_hours);   
   pan_setdigits(clock,0,260,50,"%02.f :", arial100, 1, sys_minutes);   
   pan_setdigits(clock,0,420,50,"%02.f", arial100, 1, sys_seconds);   
   pan_setcolor(clock,1,1,COLOR_GREEN);
   pan_setcolor(clock,1,2,COLOR_BLUE);
   pan_setcolor(clock,1,3,COLOR_RED);
   set(clock,SHOW);
}

See also:

PANEL, pan_setdigits, pan_setbutton, pan_setslider, pan_setwindow, pan_setpos

► latest version online