mod/maxgui.mod/fltkmaxgui.mod/src/Fl_get_system_colors.cxx
void Fl::background(uchar r, uchar g, uchar b) {
  fl_bg_set = 1;

  // replace the gray ramp so that FL_GRAY is this color
  if (!r) r = 1; else if (r==255) r = 254;
  double powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
  if (!g) g = 1; else if (g==255) g = 254;
  double powg = log(g/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
  if (!b) b = 1; else if (b==255) b = 254;
  double powb = log(b/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
  for (int i = 0; i < FL_NUM_GRAY; i++) {
    double gray = i/(FL_NUM_GRAY-1.0);
    Fl::set_color(fl_gray_ramp(i),
		  uchar(pow(gray,powr)*255+.5),
		  uchar(pow(gray,powg)*255+.5),
		  uchar(pow(gray,powb)*255+.5));
  }
}
/**
    Changes fl_color(FL_BACKGROUND_COLOR) to the given color, 
    and changes the gray ramp from 32 to 56 to black to white.  These are 
    the colors used as backgrounds by almost all widgets and used to draw 
    the edges of all the boxtypes.
*/
Changes fl_color(FL_BACKGROUND_COLOR) to the given color,
and changes the gray ramp from 32 to 56 to black to white.  These are
the colors used as backgrounds by almost all widgets and used to draw
the edges of all the boxtypes.
Changes fl_color ( FL_BACKGROUND_COLOR ) to the given color and changes the gray ramp from 32 to 56 to black to white . These are the colors used as backgrounds by almost all widgets and used to draw the edges of all the boxtypes .
void Fl::background(uchar r, uchar g, uchar b) {
  fl_bg_set = 1;
  if (!r) r = 1; else if (r==255) r = 254;
  double powr = log(r/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
  if (!g) g = 1; else if (g==255) g = 254;
  double powg = log(g/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
  if (!b) b = 1; else if (b==255) b = 254;
  double powb = log(b/255.0)/log((FL_GRAY-FL_GRAY_RAMP)/(FL_NUM_GRAY-1.0));
  for (int i = 0; i < FL_NUM_GRAY; i++) {
    double gray = i/(FL_NUM_GRAY-1.0);
    Fl::set_color(fl_gray_ramp(i),
		  uchar(pow(gray,powr)*255+.5),
		  uchar(pow(gray,powg)*255+.5),
		  uchar(pow(gray,powb)*255+.5));
  }
}
void Fl :: background ( uchar r , uchar g , uchar b ) { fl_bg_set = 1 ; if ( ! r ) r = 1 ; else if ( r == 255 ) r = 254 ; double powr = log ( r / 255.0 ) / log ( ( FL_GRAY - FL_GRAY_RAMP ) / ( FL_NUM_GRAY - 1.0 ) ) ; if ( ! g ) g = 1 ; else if ( g == 255 ) g = 254 ; double powg = log ( g / 255.0 ) / log ( ( FL_GRAY - FL_GRAY_RAMP ) / ( FL_NUM_GRAY - 1.0 ) ) ; if ( ! b ) b = 1 ; else if ( b == 255 ) b = 254 ; double powb = log ( b / 255.0 ) / log ( ( FL_GRAY - FL_GRAY_RAMP ) / ( FL_NUM_GRAY - 1.0 ) ) ; for ( int i = 0 ; i < FL_NUM_GRAY ; i ++ ) { double gray = i / ( FL_NUM_GRAY - 1.0 ) ; Fl :: set_color ( fl_gray_ramp ( i ) , uchar ( pow ( gray , powr ) * 255 + .5 ) , uchar ( pow ( gray , powg ) * 255 + .5 ) , uchar ( pow ( gray , powb ) * 255 + .5 ) ) ; } }
Changes fl_color(FL_BACKGROUND_COLOR) to the given color,
and changes the gray ramp from 32 to 56 to black to white.
Changes fl_color ( FL_BACKGROUND_COLOR ) to the given color and changes the gray ramp from 32 to 56 to black to white .
// replace the gray ramp so that FL_GRAY is this color