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.
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 Stop
s 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.extends