Gradient
class Gradient
A color gradient represented as an array of color stops, each having a parametric location value.
-
The coordinates of gradient’s start point within its reference coordinate system.
Declaration
var from: Point { get }
-
The coordinates of gradient’s end point within its reference coordinate system.
Declaration
var to: Point { get }
-
The end point corresponds to the last stop of the gradient.
Declaration
var caGradientLayerEndPoint: Point { get }
-
The gradient’s type. A gradient can be of 3 different types:
linear
,radial
orangular
.Declaration
var type: String { get }
-
An ordered list of the gradient’ stops which determines the gradient’s color transitions. A gradient must have at least two stops, one for the initial and final color.
Declaration
var stops: Array { get }
-
The aspect ratio of the ellipse containing the gradient. Only applies when
type
isradial
.Declaration
var ellipseAspectRatio: Double { get }
-
The object’s description
Declaration
var description: String { get }
-
Compares two values for equality.
The
equals
function is invoked using infix notation as in the following code snippet:lhs == rhs
.Declaration
func equals(_ lhs: Gradient) -> Bool
Parameters
lhsA value.
rhsAnother value.
Return Value
true
if thelhs
andrhs
are equal,false
otherwise.