ViewGradient

public struct ViewGradient

Represents a gradient that can be applied to a view. It can have many colors distributed in many ways and directions.

Note

There can only be one gradient at a time in a view.
  • Direction of the gradient.

    Declaration

    Swift

    public let direction: GradientDirection
  • GradientColors involved in the order involved.

    Declaration

    Swift

    public let colors: [GradientColor]
  • Initializes an inmutable ViewGradient.

    Declaration

    Swift

    public init(colors: [GradientColor], direction: GradientDirection)

    Parameters

    colors

    Array of GradientColors to be used.

    direction

    Direction in which the gradient should develop.

  • Initializes an inmutable ViewGradient.

    Declaration

    Swift

    public init(colors: [UIColor], direction: GradientDirection)

    Parameters

    colors

    Array of UIColors in the order in which to place them. They will be evenly separated.

    direction

    Direction in which the gradient should develop.