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 }
  • to

    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 or angular.

    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 distance between the points to and from. When type is radial, radius corresponds to the gradients actual radius.

    Declaration

    var radius: Double { get }
  • The aspect ratio of the ellipse containing the gradient. Only applies when type is radial.

    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

    lhs

    A value.

    rhs

    Another value.

    Return Value

    true if the lhs and rhs are equal, false otherwise.