Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_spectrum.c Log Message: Fixed sanity checks for HSV values from Colin Pitrat. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_spectrum.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -3 -r1.5 -r1.6 --- ewl_spectrum.c 14 Jun 2005 21:23:07 -0000 1.5 +++ ewl_spectrum.c 20 Jun 2005 01:52:19 -0000 1.6 @@ -334,13 +334,14 @@ if( max != 0 ) *s = (float)delta / (float)max; // s else { - // r = g = b = 0 // s = 0, v is undefined *s = 0; *h = 0; return; } - if( r == max ) + if(delta == 0) + *h = 0; + else if( r == max ) *h = (float)( g - b ) / (float)delta; // between yellow & magenta else if( g == max ) *h = 2.0 + (float)( b - r ) / (float)delta; // between cyan & yellow ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs