Comparing colors in Objective-C
I'm trying to determine if two colors are equivalent, using code written in Objective-C. I'm using this snippet of code to determine if the two colors are equivalent (currently for debugging purposes) NSLog(@"currentColor is %@", currentColor); NSLog(@"Adjacent Color is %@",[[buttonArray objectAtIndex:1] backgroundColor]); NSLog(@"%i",[[buttonArray objectAtIndex:1] backgroundColor]==currentColor); My console is showing 2009-10-20 00:27:10.814 colorGame[13588:207] currentColor is kCGColorSpaceModelRGB 0 0 1 1 2009-10-20 00:27:10.815 colorGame[13588:207] Adjacent Color is kCGColorSpaceModelRGB 0