Skip to content

Commit

Permalink
Fixed RGBToHSL() for blue.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmkilger committed Oct 26, 2016
1 parent afa32fd commit 237d2cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ImageAdditions/UIImage+ImageColoring.m
Expand Up @@ -54,9 +54,9 @@ static inline void RGBToHSL(CGFloat r, CGFloat g, CGFloat b, CGFloat * h, CGFloa
else
*s = (maxcolor - mincolor)/(2.0 - maxcolor - mincolor);

if (r > g && r > b)
if (r >= g && r >= b)
*h = (g - b)/(maxcolor - mincolor);
else if (g > r && g > b)
else if (g >= r && g >= b)
*h = 2.0 + (b - r)/(maxcolor - mincolor);
else
*h = 4.0 + (r - g)/(maxcolor - mincolor);
Expand Down

0 comments on commit 237d2cd

Please sign in to comment.