UIColor+iOS7Colors adds convenience accessors for some nice looking colors for iOS 7 I found on ios7colors.com.
Use this the same way you use any other category. You should be able to use the familiar UIColor static helper syntax.
#import "UIColor+iOS7Colors.h"
[UIColor iOS7orangeColor]
- Profit
Gradient usage is a smidgen more complicated because gradients are more complicated. Here's a snippet (slighly modified for clarity) from a recent project that was the impetus for my adding gradients:
NSArray *gradientColors = [UIColor iOS7greenGradient];
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
CGGradientRef gradient = CGGradientCreateWithColors(colorSpace, (CFArrayRef)gradientColors, NULL);
CGColorSpaceRelease(colorSpace), colorSpace = NULL;
CGPoint startPoint = square.origin;
CGPoint endPoint = CGPointMake(square.origin.x, CGRectGetMaxY(square));
CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, 0);
CGGradientRelease(gradient), gradient = NULL;
- I'm using colors listed on ios7colors.com
- I got the idea to make an extension from Class Lange's iOS7Colors
- I got the idea to add gradients from Jason Grandelli's KXKiOS7ColorsAndGradients
- I got the idea for the macros from Tomer Shiri's Objective-C-Generics
MIT License