Type Method

colorWithCGColor:

Creates a color object from a Quartz color.

Declaration

+ (instancetype)colorWithCGColor:(CGColorRef)c;

Parameters

c

A Quartz color (CGColorRef object) created using a Quartz color creation function such as CGColorCreate.

Return Value

A Core Image color object that represents a Quartz color.

Discussion

A CGColorRef object is the fundamental opaque data type used internally by Quartz to represent colors. For more information on Quartz 2D color and color spaces, see Quartz 2D Programming Guide.

You can pass a CGColorRef object that represents any color space, including CMYK. However, Core Image converts all color spaces to the Core Image working color space before it passes the color to the filter kernel. The Core Image working color space uses three color components plus alpha.

See Also

Creating Color Objects

+ colorWithRed:green:blue:

Creates a color object using the specified RGB color component values

+ colorWithRed:green:blue:alpha:

Creates a color object using the specified RGBA color component values.

+ colorWithString:

Creates a color object using the RGBA color component values specified by a string.

+ colorWithRed:green:blue:colorSpace:

Initializes a Core Image color object with the specified red, green, and blue component values as measured in the specified color space.

+ colorWithRed:green:blue:alpha:colorSpace:

Creates a Core Image color object with the specified red, green, blue, and alpha component values as measured in the specified color space.