Creates a pattern color space.


init?(patternBaseSpace baseSpace: CGColorSpace?)



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 Color Spaces

init?(iccBasedNComponents: Int, range: UnsafePointer<CGFloat>?, profile: CGDataProvider, alternate: CGColorSpace?)

Creates a device-independent color space that is defined according to the ICC color profile specification.

init?(indexedBaseSpace: CGColorSpace, last: Int, colorTable: UnsafePointer<UInt8>)

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

init?(labWhitePoint: UnsafePointer<CGFloat>, blackPoint: UnsafePointer<CGFloat>?, range: UnsafePointer<CGFloat>?)

Creates a device-independent color space that is relative to human color perception, according to the CIE L*a*b* standard.

init?(iccProfileData: CFData)

Creates an ICC-based color space using the ICC profile contained in the specified data.

init?(name: CFString)

Creates a specified type of Quartz color space.

init?(platformColorSpaceRef: UnsafeRawPointer)

Creates a platform-specific 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