xforms-development
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XForms] Color chooser bug


From: SBP
Subject: [XForms] Color chooser bug
Date: Sat, 15 Oct 2016 03:17:34 -0500

Hi there

I found a little bug in the color chooser goodie, whereon the RGB input
values are clamped to 0-100 instead of 0-255, which is the correct one
as the functions rgb2hsv and hsv2rgb work with rgb values in this range.

<< PATCH
--- goodie_colchooser.c~        2014-06-02 16:10:09.000000000 -0500
+++ goodie_colchooser.c 2016-10-15 00:50:26.751957912 -0500
@@ -406,7 +406,7 @@
     COLOR_CHOOSER *cc = obj->u_vdata;
     int value = strtol( fl_get_input( obj ), NULL, 10 );
 
-    cc->rgb[ data ] = FL_clamp( value, 0, 100 );
+    cc->rgb[ data ] = FL_clamp( value, 0, 255 );
     fl_set_input_f( obj, "%d", cc->rgb[ data ] );
 
     rgb2hsv( cc->rgb, cc->hsv );
PATCH

Cheers!

Sirius.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]