From 9b6f68dd7ce28ca42e31af0cf2a9c2535b34553f Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Sat, 30 Oct 2010 20:16:43 +0000 Subject: Added interface to set color chooser mode (STR #2407) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7781 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Color_Chooser.H | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'FL') diff --git a/FL/Fl_Color_Chooser.H b/FL/Fl_Color_Chooser.H index 131c10d9b..f840f7aad 100644 --- a/FL/Fl_Color_Chooser.H +++ b/FL/Fl_Color_Chooser.H @@ -127,9 +127,19 @@ class FL_EXPORT Fl_Color_Chooser : public Fl_Group { static void rgb_cb(Fl_Widget*, void*); static void mode_cb(Fl_Widget*, void*); public: - /** Returns which Fl_Color_Chooser variant is currently active */ + + /** + Returns which Fl_Color_Chooser variant is currently active + \return color modes are rgb(0), byte(1), hex(2), or hsv(3) + */ int mode() {return choice.value();} - + + /** + Set which Fl_Color_Chooser variant is currently active + \param[in] newMode color modes are rgb(0), byte(1), hex(2), or hsv(3) + */ + void mode(int newMode); + /** Returns the current hue. 0 <= hue < 6. Zero is red, one is yellow, two is green, etc. @@ -179,8 +189,8 @@ public: Fl_Color_Chooser(int X, int Y, int W, int H, const char *L = 0); }; -FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b); -FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b); +FL_EXPORT int fl_color_chooser(const char* name, double& r, double& g, double& b, int m=-1); +FL_EXPORT int fl_color_chooser(const char* name, uchar& r, uchar& g, uchar& b, int m=-1); #endif -- cgit v1.2.3