Defines | |
#define | FL_NUM_GRAY 24 |
Number of colors in gray ramp. | |
#define | FL_NUM_GREEN 8 |
#define | FL_GREEN_DELTA 1 |
#define | FL_NUM_RED 5 |
#define | FL_RED_DELTA 8 |
#define | FL_NUM_BLUE 5 |
#define | FL_BLUE_DELTA 40 |
Typedefs | |
typedef unsigned | Fl_Color |
Enumerations | |
enum | Colors { FL_NO_COLOR = 0, FL_GRAY_RAMP = 32, FL_GRAY = 49, FL_INACTIVE_COLOR = 39, FL_COLOR_CUBE = 0x38, FL_BLACK = 0x38, FL_RED = 0x58, FL_GREEN = 0x3f, FL_YELLOW = 0x5f, FL_BLUE = 0xd8, FL_MAGENTA = 0xf8, FL_CYAN = 0xdf, FL_WHITE = 0xff, FL_GRAY0 = 32, FL_DARK3 = 39, FL_DARK2 = 45, FL_DARK1 = 47, FL_LIGHT1 = 51, FL_LIGHT2 = 53, FL_LIGHT3 = 55, FL_SELECTION_COLOR = FL_GRAY, FL_FREE_COLOR = 16, FL_BLUE_SELECTION_COLOR = 0x88, FL_INVALID_COLOR = 0xFFFFFFFE } |
Pre-defined colors. More... | |
Functions | |
Fl_Color | fl_gray_ramp (int i) |
Returns a gray color value from black (i == 0) to white ( i == FL_NUM_GRAY - 1). More... | |
Fl_Color | fl_color_cube (int r, int g, int b) |
fl_color_cube. | |
Fl_Color | fl_rgb (unsigned char r, unsigned char g, unsigned char b) |
Returns Fl_Color of r,g,b. | |
FL_API Fl_Color | fl_rgb (const char *color) |
Returns Fl_Color from string e.g. More... | |
FL_API Fl_Color | fl_color_average (Fl_Color c1, Fl_Color c2, double weight) |
Returns the weighted average color between the two colors. More... | |
FL_API Fl_Color | fl_inactive (Fl_Color color) |
Returns "greyed" color between 'color' and FL_GRAY. | |
FL_API Fl_Color | fl_inactive (Fl_Color color, Fl_Flags f) |
Returns "greyed" color between 'color' and FL_GRAY. More... | |
FL_API Fl_Color | fl_contrast (Fl_Color fg, Fl_Color bg) |
Decides if 'fg' can be seen against 'bg' and returns 'fg' if so. More... | |
FL_API Fl_Color | fl_invert (Fl_Color color) |
Returns inverted color of 'color'. | |
FL_API Fl_Color | fl_get_color (Fl_Color color) |
Turns an indexed color into an rgb color by looking it up in the colormap. More... | |
FL_API void | fl_get_color (Fl_Color c, uchar &r, uchar &g, uchar &b) |
Turns an indexed color into an rgb color if necessary, and then the rgb portions of the color are extracted and put in the passed variables (r,g,b). | |
FL_API void | fl_set_color (Fl_Color index, Fl_Color color) |
Set entry index in the eFLTK colormap. More... | |
FL_API void | fl_free_color (Fl_Color c) |
Tell a colormapped-display that we don't need this indexed color anymore. More... | |
FL_API void | fl_background (Fl_Color) |
Modifies the "gray ramp" in the eFLTK colormap so that the color FL_GRAY is set the the rgb values of the passed color. More... | |
FL_API Fl_Color | fl_nearest_color (Fl_Color color) |
Turns an rgb color into an indexed color. More... | |
Fl_Color | fl_lighter (Fl_Color c) |
Returns a lighter version of the specified color. | |
Fl_Color | fl_darker (Fl_Color c) |
Returns a darker version of the specified color. |
|
Pre-defined colors. The following color constants can be used to access the colors from the eFLTK standard colormap:
Definition at line 39 of file Fl_Color.h. |
|
Modifies the "gray ramp" in the eFLTK colormap so that the color FL_GRAY is set the the rgb values of the passed color. This is the best way to change the overall color of your application, because it sets all the shaded borders and works on 8-bit screens. |
|
Returns the weighted average color between the two colors. The red, green, and blue values are averaged using the following formula: color = c1 * weight + c2 * (1 - weight)Thus, a weight value of 1.0 will return the first color, while a value of 0.0 will return the second color. |
|
Decides if 'fg' can be seen against 'bg' and returns 'fg' if so. If not this returns either FL_NO_COLOR or FL_WHITE, whichever one is more different than 'bg'. This function is often used by eFLTK for labels and text when no color is specified in the style. |
|
Tell a colormapped-display that we don't need this indexed color anymore. eFLTK will free any hardware colormap it allocated so that it can be reused by this or another program. |
|
Turns an indexed color into an rgb color by looking it up in the colormap. If 'color' is not an indexed color it is returned unchanged. |
|
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 eFLTK release. To get the closest eFLTK gray value to an 8-bit grayscale color 'I' use: fl_gray_ramp(I * (FL_NUM_GRAY - 1) / 255)
Definition at line 79 of file Fl_Color.h. |
|
Returns "greyed" color between 'color' and FL_GRAY. Only if flags 'f' has FL_INACTIVE bit set. |
|
Turns an rgb color into an indexed color. If 'color' is already an indexed color it is returned unchanged. Otherwise, the closest color from the color cube is returned. |
|
Returns Fl_Color from string e.g. "FF0000", which is same as "red". If color is not found, 0 is returned. |
|
Set entry index in the eFLTK colormap.
|