GradientColor
public struct GradientColor
Represents a color that takes place ina gradient that can be applied to a view. It has a UIColor and a location which indicates where that color should be placed in the gradient.
-
Color to use in gradient.
Declaration
Swift
public let color: UIColor -
Location where to place color inside the gradient. Number between 0 and 1 (inclusive).
Declaration
Swift
public let location: Float -
Initializes an inmutable GradientColor.
Warning
If the location isn’t between 0 and 1 (inclusive) the init will fail.Declaration
Swift
public init?(color: UIColor, location: Float)Parameters
colorUIColor to use.
locationLocations of the center of the color through out the gradient. A location is any possible number between 0 and 1, being 0 the start of the gradient and 1 the end of the gradient in the direction specified.
GradientColor Structure Reference