Century Embedded Technologies Nano-X SDK and Developer's Guide | ||
---|---|---|
Prev | Chapter 9. Common Widgets and Attributes | Next |
FLTK stores the colors of widgets as an 8-bit number that is an index into a color palette of 256 colors. This is not the X or WIN32 colormap, but instead is an internal table with fixed contents.
There are symbols for naming some of the more common colors:
FL_BLACK (this is the default label color)
FL_RED
FL_GREEN
FL_YELLOW
FL_BLUE
FL_MAGENTA
FL_WHITE (this is the default background color of text widgets)
FL_GRAY (this is the default background color of most widgets)
The widget color can be set using the color() method:
button->color(FL_RED);
Similarly, the label color can be set using the labelcolor() method:
button->labelcolor(FL_WHITE);