Created
January 19, 2015 16:38
-
-
Save catehstn/55ccd8fcf09b23be4b53 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)compareColorArrayRGBs:(NSArray *)array toExpected:(NSArray *)expected { | |
XCTAssertEqual([expected count], [array count]); | |
for (int i = 0; i < [expected count]; i++) { | |
UIColor *color = [array objectAtIndex:i]; | |
UIColor *expectedColor = [expected objectAtIndex:i]; | |
CGFloat r, g, b, a; | |
CGFloat eR, eG, eB, eA; | |
[color getRed:&r green:&g blue:&b alpha:&a]; | |
[expectedColor getRed:&eR green:&eG blue:&eB alpha:&eA]; | |
XCTAssertEqualWithAccuracy(r, eR, 0.005); | |
XCTAssertEqualWithAccuracy(g, eG, 0.005); | |
XCTAssertEqualWithAccuracy(b, eB, 0.005); | |
XCTAssertEqualWithAccuracy(a, eA, 0.005); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment