Function

CGColorCreateCopyByMatchingToColorSpace

Creates a new color in a different color space that matches the provided color.

Declaration

CGColorRef CGColorCreateCopyByMatchingToColorSpace(CGColorSpaceRef, CGColorRenderingIntent intent, CGColorRef color, CFDictionaryRef options);

Parameters

CGColorSpaceRef

The destination color space.

intent

The mechanism to use to match the color when the color is outside the gamut of the new color space.

color

The color to convert.

options

A dictionary of options used to convert the color. Currently, you should pass NULL.

Return Value

A new color in the destination color space that matches (or closely approximates) the source color.

Discussion

To create the new color, this method creates a CFColorConverterRef using the options you specified and applies it to the source color.

See Also

Creating Color Objects

CGColorCreate

Creates a color using a list of intensity values (including alpha) and an associated color space.

CGColorCreateCopy

Creates a copy of an existing color.

CGColorCreateGenericGray

Creates a color in the Generic gray color space.

CGColorCreateGenericRGB

Creates a color in the Generic RGB color space.

CGColorCreateSRGB

Creates a color in the sRGB color space.

Beta
CGColorCreateGenericCMYK

Creates a color in the Generic CMYK color space.

CGColorCreateCopyWithAlpha

Creates a copy of an existing color, substituting a new alpha value.

CGColorCreateWithPattern

Creates a color using a list of intensity values (including alpha), a pattern color space, and a pattern.

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