Instance Method

copy(alpha:)

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

Declaration

func copy(alpha: CGFloat) -> CGColor?

Parameters

color

The color to copy.

alpha

A value that specifies the desired opacity of the copy. Values outside the range [0,1] are clamped to 0 or 1.

Return Value

A copy of the specified color, using the specified alpha value. You are responsible for releasing this object using CGColorRelease.

See Also

Creating Colors

func copy() -> CGColor?

Creates a copy of an existing color.

init(gray: CGFloat, alpha: CGFloat)

Creates a color in the Generic gray color space.

init(genericGrayGamma2_2Gray: CGFloat, alpha: CGFloat)

Creates a color in the Generic gray color space with a gamma ramp of 2.2.

Beta
init(red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat)

Creates a color in the Generic RGB color space.

init?(colorSpace: CGColorSpace, components: UnsafePointer<CGFloat>)

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

init?(patternSpace: CGColorSpace, pattern: CGPattern, components: UnsafePointer<CGFloat>)

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