Ticket #230 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

HSV colorspace bug

Reported by: priyadi@priyadi.net Assigned to: somebody
Priority: normal Milestone: MochiKit 1.4
Component: component1 Version:
Severity: normal Keywords:
Cc:

Description

Color.fromHSV(0, 0, 1).toHexString() yields #000000, it should be #ffffff. Color.fromHSV(0, 0.00000000000000000000001, 1).toHexString() yields the correct result.

reproduced using mochikit 1.3.1 and latest SVN.

Change History

02/13/07 05:30:53 changed by therve@gmail.com

The good behaviour should be provided after this patch:

Index: MochiKit/Color.js
===================================================================
--- MochiKit/Color.js   (revision 1266)
+++ MochiKit/Color.js   (working copy)
@@ -476,9 +476,9 @@
         var green;
         var blue;
         if (saturation === 0) {
-            red = 0;
-            green = 0;
-            blue = 0;
+            red = value;
+            green = value;
+            blue = value;
         } else {
             var i = Math.floor(hue * 6);
             var f = (hue * 6) - i;

02/17/07 09:16:16 changed by priyadi@priyadi.net

thanks, that solved the problem.

03/12/07 19:50:29 changed by bob@redivi.com

  • status changed from new to closed.
  • resolution set to fixed.