From ef36be385e5bedc22f5e1da11b5eca4a55d3c0b5 Mon Sep 17 00:00:00 2001
From: Michael R Sweet This appendix lists the enumerations provided in the
+<FL/Enumerations.H> header file, organized by
+section. Constants whose value is zero are marked with "(0)",
+this is often useful to know when programming.
+
The Fl_Color enumeration type holds a FLTK color value.
+Colors are either 8-bit indexes into a virtual colormap or 24-bit RGB
+color values. Color indices occupy the lower 8 bits of the value, while
+RGB colors occupy the upper 24 bits, for a byte organization of RGBI.
+
+ Constants are defined for the user-defined foreground and background
+colors, as well as specific colors and the start of the grayscale ramp
+and color cube in the virtual colormap. Inline functions are provided to
+retrieve specific grayscale, color cube, or RGB color values.
+
+ The following color constants can be used to access the user-defined
+colors:
+
+ The following color constants can be used to access the colors from the
+FLTK standard color cube:
+
The inline methods for getting a grayscale, color cube, or RGB color
+value are described next.
+
+ Returns a gray color value from black (i == 0) to
+white (i == FL_NUM_GRAY - 1). FL_NUM_GRAY is
+defined to be 24 in the current FLTK release. To get the closest
+FLTK gray value to an 8-bit grayscale color 'I' use:
- Fl_Color fl_gray_ramp(int i)
- 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);
+ To get the closest color to a 8-bit set of R,G,B values use:
- Fl_Color fl_rgb_color(uchar r, uchar g, uchar b)
+ Returns the 24-bit RGB color value for the specified 8-bit
+RGB or grayscale values.
C - FLTK Enumerations
- This appendix lists the enumerations provided in the
-<FL/Enumerations.H> header file, organized by section.
-Constants whose value is zero are marked with "(0)", this is often
-useful to know when programming.
+
+Version Numbers
The FLTK version number is stored in a number of compile-time
constants:
@@ -177,42 +179,93 @@ bold-oblique.
Colors
- The following color constants can be used to access the colors in the
-FLTK standard color palette:
+
+Color Constants
+
+
+
+
+
+
-
-In addition there are two inline functions to allow you to select
-grays or colors from the FLTK colormap:
+Color Functions
+
+Fl_Color fl_gray_ramp(int i)
+
+
Returns 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_gray_ramp(I * (FL_NUM_GRAY - 1) / 255)
+
-
Returns a color out of the color cube.
+Fl_Color fl_color_cube(int r, int g, int b)
+
+fl_color_cube(R * (FL_NUM_RED - 1) / 255,
+ G * (FL_NUM_GREEN - 1) / 255,
+ B * (FL_NUM_BLUE - 1) / 255);
+
+
+Fl_Color fl_rgb_color(uchar r, uchar g, uchar b)
+
+
+Fl_Color fl_rgb_color(uchar g)Cursors
@@ -220,30 +273,40 @@ B*FL_NUM_BLUE/256);
FLTK. The double-headed arrows are bitmaps
provided by FLTK on X, the others are provided by system-defined
cursors.