Definition

public enum Definition

Defines the colors of a given type.

  • Defines a simple gradient, that has a start color and an end color

    Declaration

    Swift

    case simple(startColor: UIColor, endColor: UIColor)
  • Defines a custom gradient, that has as many colors and location point as wanted. It should at least contain 2 elements. When used in GradientView, it ensures that it is the case, and will report a crash at runtime if the array has less than 2 elements.

    Declaration

    Swift

    case custom([(color: UIColor, location: CGFloat)])
  • Get the start color of the receiver. If the current value is .simple, returns startColor. If the current value is .custom, returns the first color of the array. If the array is empty, this will crash at runtime.

    Declaration

    Swift

    public var startColor: UIColor { get }
  • Get the end color of the receiver. If the current value is .simple, returns endColor. If the current value is .custom, returns the last color of the array. If the array is empty, this will crash at runtime.

    Declaration

    Swift

    public var endColor: UIColor { get }