Instance Method

interpolatedColorAtLocation:

Returns the color of the rendered gradient at the specified relative location.

Declaration

- (NSColor *)interpolatedColorAtLocation:(CGFloat)location;

Parameters

location

The location value for the color you want. This value must be between 0.0 and 1.0. This value need not correspond to the location of one of the color objects used to create the gradient.

Discussion

This method does not simply return the color values used to initialize the receiver. Instead, it computes the value that would be drawn at the specified location.

The start color of the gradient is always located at 0.0 and the end color is always at 1.0.

See Also

Getting Gradient Properties

colorSpace

The color space of the colors associated with the gradient.

numberOfColorStops

The number of color stops associated with the gradient.

- getColor:location:atIndex:

Returns information about the color stop at the specified index in the receiver’s color array.