Colors

The following color constants can be used to access the colors in the FLTK standard color palette:

In addition there are two inline functions to allow you to select grays or colors from the FLTK colormap:

Fl_Color fl_gray_ramp(int i)

Returs a gray color. Returns black for zero, returns white for FL_NUM_GRAY (which is 24) minus 1. To get the closest to an 8-bit gray value 'I' use fl_gray_ramp(I*FL_NUM_GRAY/256)

Fl_Color fl_color_cube(int r, int g, int b)

Returns a color out of the color cube.

To get the closest color to a 8-bit set of R,G,B values use fl_color_cube(R*FL_NUM_RED/256, G*FL_NUM_GREEN/256, B*FL_NUM_BLUE/256);