CGColor


Function Summary
CGColorCGColorCreate(aColorSpace, components)
          Creates a new CGColor.
CGColorCGColorCreateCopy(aColor)
          Creates a copy of a color.
CGColorCGColorCreateGenericGray(gray, alpha)
          Creates a gray color object.
CGColorCGColorCreateGenericRGB(red, green, blue, alpha)
          Creates an RGB color.
CGColorCGColorCreateGenericCMYK(cyan, magenta, yellow, black, alpha)
          Creates a CMYK color.
CGColorCGColorCreateCopyWithAlpha(aColor, anAlpha)
          Creates a copy of the color with a specified alpha.
CGColorCGColorCreateWithPattern(aColorSpace, aPattern, components)
          Creates a color using the specified pattern.
floatCGColorGetAlpha(aColor)
          Returns the color's alpha component.
nullCGColorGetColorSpace(aColor)
          Returns the CGColor's color space.
CPNumberCGColorGetNumberOfComponents(aColor)
          Returns the number of color components (including alpha) in the specified color.
CGPatternFIXMECGColorGetPattern(aColor)
          Gets the CGColor's pattern.

Function Detail

CGColorCreate

function CGColorCreate(aColorSpace, components)
Creates a new CGColor.
Arguments
aColorSpace - the CGColorSpace of the color
components - the color's intensity values plus alpha
Returns:
the new color object

CGColorCreateCopy

function CGColorCreateCopy(aColor)
Creates a copy of a color... but not really. CGColors are immutable, so to be efficient, this function will just return the same object that was passed in.
Arguments
aColor - the CGColor to 'copy'
Returns:
the color copy

CGColorCreateGenericGray

function CGColorCreateGenericGray(gray, alpha)
Creates a gray color object.
Arguments
gray - the value to use for the color intensities (0.0-1.0)
alpha - the gray's alpha value (0.0-1.0)
Returns:
the new gray color object

CGColorCreateGenericRGB

function CGColorCreateGenericRGB(red, green, blue, alpha)
Creates an RGB color.
Arguments
red - the red component (0.0-1.0)
green - the green component (0.0-1.0)
blue - the blue component (0.0-1.0)
alpha - the alpha component (0.0-1.0)
Returns:
the RGB based color

CGColorCreateGenericCMYK

function CGColorCreateGenericCMYK(cyan, magenta, yellow, black, alpha)
Creates a CMYK color.
Arguments
cyan - the cyan component (0.0-1.0)
magenta - the magenta component (0.0-1.0)
yellow - the yellow component (0.0-1.0)
black - the black component (0.0-1.0)
alpha - the alpha component (0.0-1.0)
Returns:
the CMYK based color

CGColorCreateCopyWithAlpha

function CGColorCreateCopyWithAlpha(aColor, anAlpha)
Creates a copy of the color with a specified alpha.
Arguments
aColor - the color object to copy
anAlpha - the new alpha component for the copy (0.0-1.0)
Returns:
the new copy

CGColorCreateWithPattern

function CGColorCreateWithPattern(aColorSpace, aPattern, components)
Creates a color using the specified pattern.
Arguments
aColorSpace - the CGColorSpace
aPattern - the pattern image
components - the color components plus the alpha component
Returns:
the patterned color

CGColorGetAlpha

function CGColorGetAlpha(aColor)
Returns the color's alpha component.
Arguments
aColor - the color
Returns:
the alpha component (0.0-1.0)

CGColorGetColorSpace

function CGColorGetColorSpace(aColor)
Returns the CGColor's color space.
Arguments
aColor

CGColorGetNumberOfComponents

function CGColorGetNumberOfComponents(aColor)
Returns the number of color components (including alpha) in the specified color.
Arguments
aColor - the CGColor
Returns:
the number of components

CGColorGetPattern

function CGColorGetPattern(aColor)
Gets the CGColor's pattern.
Arguments
aColor
Returns:
the pattern image