I have some code which I can't figure out why it's not working,
UIColor *lastColor, *red;
red = [UIColor colorWithRed:0.993 green:0.34444 blue:0.0 alpha:1.0];
NSString *chosenColor;
if([lastColor isEqual: red])
{
chosenColor = @"red";
}
I have also found some people making an override of the isEqual method, isEqualtoColor: But this didn't work either and i fed that one lastColor.CGColor;
Everywhere I've read that isEqual is all you need to compare the UIColors, im currently resorting to an array of strings for red, green and blue and comparing the float value to the CGColorGetComponents(lastColor);
But this isn't working either.
gist.github.com/mtabini/716917
The link above works like a charm. Thanks awfully "Count Chocula" both a delicious source of chocolate and iphone answers :P
I'd click answered to your post but it would more then likly misslead any people wondering on here.
Must have just been a float tolerance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With