From ef36be385e5bedc22f5e1da11b5eca4a55d3c0b5 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 11 Apr 2002 10:46:19 +0000 Subject: Redefine FL_ color values to use the color cube. Add FL_BACKGROUND_COLOR, FL_BACKGROUND2_COLOR, and FL_FOREGROUND_COLOR, and use them instead of FL_GRAY, FL_WHITE, and FL_BLACK, respectively. (FL_GRAY defined to FL_BACKGROUND_COLOR for back-compatibility) Add fl_rgb_color(uchar g) inline method to map 8-bit grayscale to 24-bit RGB color. Doco updates for all of this... git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2072 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/enumerations.html | 159 ++++++++++++++++++++++++++++------------ 1 file changed, 111 insertions(+), 48 deletions(-) (limited to 'documentation') diff --git a/documentation/enumerations.html b/documentation/enumerations.html index 9651a9e22..8c6c98951 100644 --- a/documentation/enumerations.html +++ b/documentation/enumerations.html @@ -1,9 +1,11 @@

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. + +

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: + +

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. + +

Color Constants

+ +

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: +

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

The inline methods for getting a grayscale, color cube, or RGB color +value are described next. + +

Color Functions

+ +

Fl_Color fl_gray_ramp(int i)

+ +

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) -
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_Color fl_color_cube(int r, int g, int b) -
Returns a color out of the color cube. +

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) +

+ +

Fl_Color fl_rgb_color(uchar r, uchar g, uchar b)
+Fl_Color fl_rgb_color(uchar g)

+ +

Returns the 24-bit RGB color value for the specified 8-bit +RGB or grayscale values.

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.

+ +

FD "When" Conditions

+ +

Damage Masks

The following damage mask bits are used by the standard FLTK widgets: