Instance Method

initWithCGColor:

Initializes a Core Image color object with a Core Graphics color.

Declaration

- (instancetype)initWithCGColor:(CGColorRef)c;

Parameters

c

A Core Graphics color value.

Return Value

The resulting Core Image color.

Discussion

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

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

See Also

Initializing Color Objects

- initWithColor:

Initializes a Core Image color object using a UIKit (or AppKit) color object.

- initWithRed:green:blue:

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

- initWithRed:green:blue:alpha:

Initializes a Core Image color object with the specified red, green, blue, and alpha component values.

- initWithRed: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.

- initWithRed:green:blue:alpha:colorSpace:

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