Re: [AD] 4.0.2 release

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


> OK, I read a bit of that thread on [AL]. I think the best solution would
> be to add `case 6' right in front of `case 0'; that should allow any
> hue. (Allowing any hue is a Good Thing IMHO because it's usually
> depicted as a circle (in particular, the range 0...360 suggests
> degrees), and it's continuous that way. Plus, if even Allegro's examples
> assume negative hue is ok, chances are that other people do it too.)

There is still a problem though: now 360-epsilon, which gives i = 6, is
treated like 0-60. I think that's wrong, because 360-epsilon is a valid
value within the range 0-360, contrary to -epsilon, and should be treated
like 300-360. So the only change I would make is:

--- cvsroot/allegro/src/color.c Sun Jun  9 12:39:02 2002
+++ allegro/src/color.c Wed Jun 12 10:30:44 2002
@@ -366,6 +366,7 @@
   case 2: *r = x; *g = v; *b = z; break;
   case 3: *r = x; *g = y; *b = v; break;
   case 4: *r = z; *g = x; *b = v; break;
+  case 6: /* reached when h = 360.0f - epsilon */
   case 5: *r = v; *g = x; *b = y; break;
       }
    }

> I attach an updated patch which adds the same check for negative values
> as my previous patch, adds 'case 6' in front of 'case 0', and makes
> float-->int conversion be rounded (now hsv_to_rgb() is always the exact
> inverse of rgb_to_hsv()).

Ok for the float->int conversion, but not for the other changes.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/