Skip to content

Commit

Permalink
fix for error on complementaryColor: where the degree value was not d…
Browse files Browse the repository at this point in the history
…ivided by 360.0 before adding to Hue

this caused the complementary color to almost always be red
  • Loading branch information
Chad Sager committed Mar 26, 2014
1 parent a165769 commit e27c8eb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Colours.m
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,9 @@ - (instancetype)blackOrWhiteContrastingColor
- (instancetype)complementaryColor
{
NSMutableDictionary *hsba = [[self hsbaDictionary] mutableCopy];
float newH = [[self class] addDegrees:180.0f toDegree:([hsba[kColoursHSBA_H] floatValue]*360)];
[hsba setObject:@(newH) forKey:kColoursHSBA_H];
float newH = [[self class] addDegrees:180.0f toDegree:([hsba[kColoursHSBA_H] floatValue]*360.0f)];
[hsba setObject:@(newH/360.0f) forKey:kColoursHSBA_H];
return [[self class] colorFromHSBADictionary:hsba];

}


Expand Down

0 comments on commit e27c8eb

Please sign in to comment.