Contents

CGGradient

A definition for a smooth transition between colors for drawing radial and axial gradient fills.

Declaration

class CGGradient

Overview

A gradient defines a smooth transition between colors across an area. A CGGradient has a color space, two or more colors, and a location for each color. The color space cannot be a pattern or indexed color space, otherwise it can be any Core Graphics color space (CGColorSpace).

Colors can be provided as component values (such as red, green, blue) or as Core Graphics color objects (CGColor). Component values can vary from 0.0 to 1.0, designating the proportion of the component present in the color.

A location is a normalized value. When it comes time to paint the gradient, Core Graphics maps the normalized location values to the points in coordinate space that you provide.

For more precise control over gradients, see CGShading.

Topics

Creating Gradient Instances

Working with Core Foundation Types

Initializers

Instance Properties

See Also

Utility and Support Classes