From fc1a878290197e5e4ec037e65662a90c8f5ce3a8 Mon Sep 17 00:00:00 2001 From: engelsman Date: Wed, 27 Oct 2010 22:07:55 +0000 Subject: reworked color documentation as suggested in STR #2373 part of the confusion was the main page link to Common Widgets and Attributes/Colors actually went to Drawing Things in FLTK/Colors therefore making it harder to find information. Common Widgets and Attribute/Colors now simplified Drawing Things in FLTK/Colors now expanded FLTK Enumerations/Colors now simplified git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7762 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- documentation/src/common.dox | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'documentation/src/common.dox') diff --git a/documentation/src/common.dox b/documentation/src/common.dox index 6b3e19587..37a068b26 100644 --- a/documentation/src/common.dox +++ b/documentation/src/common.dox @@ -174,6 +174,12 @@ colors or a 24-bit RGB color. The color palette is \e not the X or WIN32 colormap, but instead is an internal table with fixed contents. +See the +\ref drawing_colors +section of +\ref drawing +for implementation details. + There are symbols for naming some of the more common colors: \li \p FL_BLACK @@ -186,20 +192,23 @@ There are symbols for naming some of the more common colors: \li \p FL_WHITE \li \p FL_WHITE -These symbols are the default colors for all FLTK widgets. They are -explained in more detail under -\ref enumerations_colors in -\ref enumerations. +Other symbols are used as the default colors for all FLTK widgets. \li \p FL_FOREGROUND_COLOR \li \p FL_BACKGROUND_COLOR \li \p FL_INACTIVE_COLOR \li \p FL_SELECTION_COLOR -RGB colors can be set using the \p fl_rgb_color() function: +The full list of named color values can be found in +\ref enumerations_colors "FLTK Enumerations". + +A color value can be created from its RGB components by using the +\p %fl_rgb_color() function, and decomposed again with +\p Fl::get_color(): \code -Fl_Color c = fl_rgb_color(85, 170, 255); +Fl_Color c = fl_rgb_color(85, 170, 255); // RGB to Fl_Color +Fl::get_color(c, r, g, b); // Fl_Color to RGB \endcode The widget color is set using the \p color() method: -- cgit v1.2.3