CAGradientLayer Class Reference
| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/QuartzCore.framework |
| Availability | Available in OS X v10.6 and later. |
| Declared in | CAGradientLayer.h |
Overview
The CAGradientLayer class draws a color gradient over its background color, filling the shape of the layer (including rounded corners)
Tasks
Gradient Style Properties
-
colorsproperty -
locationsproperty -
endPointproperty -
startPointproperty -
typeproperty
Properties
colors
An array of CGColorRef objects defining the color of each gradient stop. Animatable.
Discussion
Defaults to nil.
Availability
- Available in OS X v10.6 and later.
Declared In
CAGradientLayer.hendPoint
The end point of the gradient when drawn in the layer’s coordinate space. Animatable.
Discussion
The end point corresponds to the last stop of the gradient. The point is defined in the unit coordinate space and is then mapped to the layer’s bounds rectangle when drawn.
Default value is (0.5,1.0).
Availability
- Available in OS X v10.6 and later.
Declared In
CAGradientLayer.hlocations
An optional array of NSNumber objects defining the location of each gradient stop. Animatable.
Discussion
The gradient stops are specified as values between 0 and 1. The values must be monotonically increasing. If nil, the stops are spread uniformly across the range. Defaults to nil.
When rendered, the colors are mapped to the output color space before being interpolated.
Availability
- Available in OS X v10.6 and later.
Declared In
CAGradientLayer.hstartPoint
The start point of the gradient when drawn in the layer’s coordinate space. Animatable.
Discussion
The start point corresponds to the first stop of the gradient. The point is defined in the unit coordinate space and is then mapped to the layer’s bounds rectangle when drawn.
Default value is (0.5,0.0).
Availability
- Available in OS X v10.6 and later.
Declared In
CAGradientLayer.htype
Style of gradient drawn by the layer.
Discussion
Defaults to kCAGradientLayerAxial.
Availability
- Available in OS X v10.6 and later.
Declared In
CAGradientLayer.hConstants
Gradient Types
The style of gradient drawn by the layer.
NSString * const kCAGradientLayerAxial
Constants
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-03-09)