Instance Method


Creates a color object using the specified image object.


- (UIColor *)initWithPatternImage:(UIImage *)image;



The image to use when creating the pattern color.

Return Value

The pattern color.


You can use pattern colors to set the fill or stroke color just as you would a solid color. During drawing, the image in the pattern color is tiled as necessary to cover the given area.

By default, the phase of the returned color is 0, which causes the top-left corner of the image to be aligned with the drawing origin. To change the phase, make the color the current color and then use the CGContextSetPatternPhase function to change the phase.

See Also

Creating a Pattern-Based Color

+ colorWithPatternImage:

Creates a color object using the specified image.