Created
October 3, 2011 15:41
-
-
Save madninja/1259398 to your computer and use it in GitHub Desktop.
CGGradientUtils
This file contains 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
CGGradientRef CGGradientCreateWithUIColors(CGColorSpaceRef space, NSArray *colors, const CGFloat locations[]) | |
{ | |
NSMutableArray *cgColors = [NSMutableArray arrayWithCapacity:colors.count]; | |
[colors enumerateObjectsUsingBlock:^(UIColor *color, NSUInteger idx, BOOL *stop) { | |
[cgColors addObject:(id)color.CGColor]; | |
}]; | |
return CGGradientCreateWithColors(space, (CFArrayRef)cgColors, locations); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment