Century Embedded Technologies Nano-X SDK and Developer's Guide | ||
---|---|---|
Prev | Appendix C. Enumeration Reference | Next |
The following color constants can be used to access the colors in the FLTK standard color palette:
FL_BLACK - the default label color (0)
FL_RED
FL_GREEN
FL_YELLOW
FL_BLUE
FL_MAGENTA
FL_CYAN
FL_WHITE - the default background for text
FL_SELECTION_COLOR - change to dark blue for Windows style
FL_GRAY - the default color.
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.
r must be in the range 0 to FL_NUM_RED (5) minus 1.
g must be in the range 0 to FL_NUM_GREEN (8) minus 1.
b must be in the range 0 to FL_NUM_BLUE (5) minus 1.
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);