- (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