Skip to content

Latest commit

 

History

History
39 lines (23 loc) · 989 Bytes

README.md

File metadata and controls

39 lines (23 loc) · 989 Bytes

#PAGradientColor

iOS 4.0 minimum.

##License

Without any further information, all the sources provided here are under the MIT License quoted in PAGradientColor/LICENSE.

##What is PAGradientColor

PAGradientColor is an Objective-C wrapper for CGGradient. Useful for your iOS projects. It Offers you the ability to create a nice gradient with just one line of code. For example:

+ (id)gradientWithStartingColor:(UIColor *)startingColor 
					endingColor:(UIColor *)endingColor;
+ (id)gradientWithColors:(NSArray *)colors

Once your PAGradientColor object has been created, you can use the drawing method from any graphics context :

@implement MyCustomView
@synthesize gradient = _gradient;

- (void)drawRect:(CGRect)rect
{
	[self gradient] drawInRect:rect angle:90];
}

@end

As simple as that.

Please notice that this is a first draft of the wrapper. So please report any issue you may encounter. I'm also working on methods for drawing a radial gradient.

Thank you.