Skip to content

An Objective-C wrapper for CGGradient (useful for iOS)

Notifications You must be signed in to change notification settings

govindaraokondala/PAGradientColor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

#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.

About

An Objective-C wrapper for CGGradient (useful for iOS)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published