Sanko Robinson > FLTK-0.531 > FLTK::Color



Annotate this POD


View/Report Bugs
Module Version: 0.530   Source   Latest Release: FLTK-0.532005001


FLTK::Color - A color value (Wow, yeah, I know...)

Description ^

FLTK::Color is a typedef for a 32-bit integer containing r,g,b bytes and an "index" in the lowest byte (the first byte on a little-endian machine such as an x86). For instance 0xFF008000 is 255 red, zero green, and 128 blue. If rgb are not zero then the low byte is ignored, or may be treated as "alpha" by some code.

If the rgb is zero, the N is the color "index". This index is used to look up an FLTK::Color in an internal table of 255 colors shown here. All the indexed colors may be changed by using set_color_index(). However FLTK uses the ones between 32 and 255 and assummes they are not changed from their default values.

A Color of zero (FLTK::NO_COLOR) will draw black but is ambiguous. It is returned as an error value or to indicate portions of a Style that should be inherited, and it is also used as the default label color for everything so that changing color zero can be used by the -fg switch. You should use FLTK::BLACK (56) to get black.

Functions ^

Symbolic names for some of the indexed colors.

The 24-entry "gray ramp" is modified by FLTK::set_background() so that the color FLTK::GRAY75 is the background color, and the others are a nice range from black to a lighter version of the gray. These are used to draw box edges. The gray levels are chosen to be evenly spaced, listed here is the actual 8-bit and decimal gray level assigned by default. Also listed here is the letter used for FLTK::FrameBox and the old fltk1.1 names used for these levels.

The remiander of the colormap is a 5x8x5 color cube. This cube is used to dither images on 8-bit screens X colormaps to reduce the number of colors used.

syntax highlighting: