Class RadialGradient

java.lang.Object
javafx.scene.paint.Paint
javafx.scene.paint.RadialGradient

public final class RadialGradient extends Paint
The RadialGradient class provides a way to fill a shape with a circular radial color gradient pattern. The user may specify 2 or more gradient colors, and this paint will provide an interpolation between each color.

The user must specify the circle controlling the gradient pattern, which is defined by a center point and a radius. The user can also specify a separate focus point within that circle, which controls the location of the first color of the gradient. By default the focus is set to be the center of the circle.

The center and radius are specified relative to a unit square, unless the proportional variable is false. By default proportional is true, and the gradient will be scaled to fill whatever shape it is applied to. The focus point is always specified relative to the center point by an angle and a distance relative to the radius.

This paint will map the first color of the gradient to the focus point, and the last color to the perimeter of the circle, interpolating smoothly for any in-between colors specified by the user. Any line drawn from the focus point to the circumference will thus span all of the gradient colors.

The focus distance will be clamped to the range (-1, 1) so that the focus point is always strictly inside the circle.

The application provides an array of Stops specifying how to distribute the colors along the gradient. The Stop#offset variable must be the range 0.0 to 1.0 and act like keyframes along the gradient. They mark where the gradient should be exactly a particular color.

Since:
JavaFX 2.0