From 4e1a1415f6fca8d2758ff01bd2fbaa97e0bcb2d6 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sat, 20 Apr 2013 13:41:16 +0100 Subject: [PATCH] Fixed: - CPColor hsbComponents range. Previously, - CPColor hsbComponents returned degrees and percents. With the latest change to - CPColor colorWithHue:saturation:brightness: this was inconsistent. Now - CPColor hsbComponents returns its components as factors in the 0-1.0 range. --- AppKit/CPColor.j | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/AppKit/CPColor.j b/AppKit/CPColor.j index 0052438af..16ef6411f 100644 --- a/AppKit/CPColor.j +++ b/AppKit/CPColor.j @@ -603,6 +603,9 @@ var cachedBlackColor, /*! Returns an array with the HSB values for this color. + + The values are expressed as fractions between 0.0-1.0. + The index values are ordered as:
 Index   Component
@@ -649,9 +652,9 @@ var cachedBlackColor,
     }
 
     return [
-        ROUND(hue * 360.0),
-        ROUND(saturation * 100.0),
-        ROUND(brightness * 100.0)
+        hue,
+        saturation,
+        brightness
     ];
 }