LinearGradient

public struct LinearGradient: Generator

Generates a gradient that varies along a linear axis between two defined endpoints.

let logo = Image(frame: canvas.frame)
var gradient = LinearGradient()
gradient.points = [logo.origin,logo.frame.max]
logo.generate(gradient)
canvas.add(logo)
  • The name of the Core Image filter.

    Declaration

    Swift

    public let filterName = "CISmoothLinearGradient"
  • The colors of the filter. Defaults to [C4Pink, C4Blue]

    Declaration

    Swift

    public var colors: [Color] = [C4Pink, C4Blue]
  • The endpoints of the filter. Defaults to [Point(), Point(100, 100)]

    Declaration

    Swift

    public var points: [Point] = [Point(), Point(100, 100)]
  • Initializes a new filter

    Declaration

    Swift

    public init() {}
  • Applies the properties of the receiver to create a new CIFilter object

    Declaration

    Swift

    public func createCoreImageFilter() -> CIFilter

    Return Value

    The new CIFilter object.