A definition for a smooth transition between colors for drawing radial and axial gradient fills.
Framework
- Core Graphics
Overview
A gradient defines a smooth transition between colors across an area. A CGGradient
object 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 (CGColor
).
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.