summaryrefslogtreecommitdiff
path: root/src/fl_color.cxx
diff options
context:
space:
mode:
authorFabien Costantini <fabien@onepost.net>2008-09-13 22:33:03 +0000
committerFabien Costantini <fabien@onepost.net>2008-09-13 22:33:03 +0000
commit9bf19e2329a51f68b2f6b9c2d65db87ab3698f76 (patch)
tree4949368ed1aa08e8a6ecda0958788081a97f1a96 /src/fl_color.cxx
parent4159c97e420fd9cd66024a9b71aa5d143cc1b2db (diff)
WP1 merged from my branch, WP2 reserved, todo list updated.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6231 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_color.cxx')
-rw-r--r--src/fl_color.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/fl_color.cxx b/src/fl_color.cxx
index cad299f4d..4b692ac50 100644
--- a/src/fl_color.cxx
+++ b/src/fl_color.cxx
@@ -317,17 +317,30 @@ void Fl::set_color(Fl_Color i, unsigned c) {
}
#endif // end of X-specific code
-
+/**
+ Returns the RGB value(s) for the given FLTK color index. The
+ first form returns the RGB values packed in a 32-bit unsigned
+ integer with the red value in the upper 8 bits, the green value
+ in the next 8 bits, and the blue value in bits 8-15. The lower
+ 8 bits will always be 0.
+
+ <P>The second form returns the red, green, and blue values
+ separately in referenced variables.
+*/
unsigned Fl::get_color(Fl_Color i) {
if (i & 0xffffff00) return (i);
else return fl_cmap[i];
}
-
+/**
+ Sets an entry in the fl_color index table. You can set it to
+ any 8-bit RGB color. The color is not allocated until fl_color(i)
+ is used.
+*/
void Fl::set_color(Fl_Color i, uchar red, uchar green, uchar blue) {
Fl::set_color((Fl_Color)(i & 255),
((unsigned)red<<24)+((unsigned)green<<16)+((unsigned)blue<<8));
}
-
+/** See unsigned get_color(Fl_Color c) */
void Fl::get_color(Fl_Color i, uchar &red, uchar &green, uchar &blue) {
unsigned c;