Initializer

init(starting:ending:)

Initializes a newly allocated gradient object with two colors.

Declaration

convenience init?(starting startingColor: NSColor, ending endingColor: NSColor)

Parameters

startingColor

The starting color of the gradient. The location of this color is fixed at 0.0.

endingColor

The ending color of the gradient. The location of this color is fixed at 1.0.

Return Value

The initialized NSGradient object.

See Also

Initialization

init?(colors: [NSColor])

Initializes a newly allocated gradient object with an array of colors.

init?(colors: [NSColor], atLocations: UnsafePointer<CGFloat>?, colorSpace: NSColorSpace)

Initializes a newly allocated gradient object with the specified colors, color locations, and color space.