Skip to content

Commit

Permalink
Fixed blackOrWhiteContrasting color to not use the UIColor cached ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
bennyguitar committed Feb 26, 2014
1 parent 586fcc8 commit 78f854a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Colours.m
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ - (instancetype)blackOrWhiteContrastingColor
{
NSArray *rgbaArray = [self rgbaArray];
double a = 1 - ((0.299 * [rgbaArray[0] doubleValue]) + (0.587 * [rgbaArray[1] doubleValue]) + (0.114 * [rgbaArray[2] doubleValue]));
return a < 0.5 ? [[self class] blackColor] : [[self class] whiteColor];
return a < 0.5 ? [[self class] colorWithRed:0 green:0 blue:0 alpha:1] : [[self class] colorWithRed:1 green:1 blue:1 alpha:1];
}


Expand Down
4 changes: 2 additions & 2 deletions Colours.podspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Pod::Spec.new do |s|
s.name = 'Colours'
s.version = '5.1.0'
s.version = '5.1.1'
s.summary = '100s of beautiful, predefined Colors and Color methods. Works for iOS/OSX.'
s.author = {
'Ben Gordon' => '[email protected]'
}
s.source = {
:git => 'https://github.com/bennyguitar/Colours.git',
:tag => '5.1.0'
:tag => '5.1.1'
}
s.homepage = 'https://github.com/bennyguitar'
s.license = 'LICENSE'
Expand Down

0 comments on commit 78f854a

Please sign in to comment.