Contents

interpolatedColor(atLocation:)

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

Declaration

func interpolatedColor(atLocation location: CGFloat) -> NSColor

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