class Gradient
A class that represents a color gradient.
class Gradient;
Description
Use the static factory methods on UIColor to create gradients:
UIColor.linearGradient() static
Creates a linear gradient.UIColor.radialGradient() static
Creates a radial gradient (center outward).UIColor.conicGradient() static
Creates a conic gradient (sweep around center).
Examples
UIColor.linearGradient(180, UI.colors.blue, UI.colors.green)
UIColor.linearGradient(90, UI.colors.red, [UI.colors.yellow, 0.5], UI.colors.blue)
UIColor.radialGradient(UI.colors.white, UI.colors.black)
UIColor.conicGradient(0, UI.colors.red, UI.colors.yellow, UI.colors.green, UI.colors.blue)
Type members
type UIColor.Gradient.Stop static
Type definition for a gradient color stop.
Instance members
type
The type of gradient.stops
The normalized color stops with positions between 0 and 1.angle
The angle of the gradient in degrees (for linear and conic gradients).
Related
class UIColor
A class that represents a single color value.
