Function

CGColorEqualToColor

Indicates whether two colors are equal.

Declaration

bool CGColorEqualToColor(CGColorRef color1, CGColorRef color2);

Parameters

color1

The first color to compare.

color2

The second color to compare.

Return Value

A Boolean value that, if YES, indicates that the specified colors are equal. If the colors are not equal, the value is NO.

Discussion

Two colors are equal if they share the same color space and numerically equal color components.

See Also

Getting Information about Core Graphics Colors

CGColorGetAlpha

Returns the value of the alpha component associated with a color.

CGColorGetColorSpace

Returns the color space associated with a color.

CGColorGetComponents

Returns the values of the color components (including alpha) associated with a color.

CGColorGetNumberOfComponents

Returns the number of color components (including alpha) associated with a color.

CGColorGetPattern

Returns the pattern associated with a color in a pattern color space.

CGColorGetTypeID

Returns the Core Foundation type identifier for a color data type.