Instance Method

initWithStartingColor:endingColor:

Initializes a newly allocated gradient object with two colors.

Declaration

- (instancetype)initWithStartingColor:(NSColor *)startingColor endingColor:(NSColor *)endingColor;

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

- initWithColors:

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

- initWithColorsAndLocations:

Initializes a newly allocated gradient object with a comma-separated list of arguments.

- initWithColors:atLocations:colorSpace:

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