fcanas / ios-color-picker

A color picker for iOS
MIT License
119 stars 27 forks source link

Wrong gradient colors #1

Closed groupboard closed 10 years ago

groupboard commented 12 years ago

The gradient bar along the bottom is showing the wrong colors. Problem is in this method of UIColor+Expanded.m:

in these lines:

    h *= 60.0f;                                 // Convert to degrees
    if (h < 0.0f) h += 360.0f;                  // Make non-negative

Need to change them to:

            h /= 6.0f;
            if (h < 0.0f) h += 1.0f;

(if you look at this history of UIColor+HSV.m you'll see this change was made there, but was never made to UIColor+Expanded.m). The issue is that hsv values are now stored between 0.0 and 1.0 in UIColor rather than 0 and 360. I don't want to change the file, as I'm sure there are probably more places that need changed and I don't really understand what all the code does.

fcanas commented 12 years ago

Thanks for pointing this out. I'll make the change and close this issue once I'm sure there aren't any terrible repercussions.

fcanas commented 10 years ago

The project no longer has a dependency on the UIColor extension.