Creates a pattern color space.


CGColorSpaceRef CGColorSpaceCreatePattern(CGColorSpaceRef baseSpace);



For masking patterns, the underlying color space that specifies the colors to be painted through the mask. For colored patterns, you should pass NULL.

Return Value

A new pattern color space. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.


For information on creating and using patterns, see Quartz 2D Programming Guide and CGPattern. Quartz retains the color space you pass in. Upon return, you may safely release it by calling CGColorSpaceRelease.

See Also

Creating Special Color Spaces


Creates an indexed color space, consisting of colors specified by a color lookup table.


Creates a specified type of Quartz color space.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software