The
GradientPaint
class provides a way to fill a {@link Shape} with a linear color gradient pattern.If {@link Point} P1 with {@link Color} C1 and
Point
P2 with
Color
C2 are specified in user space, the
Color
on the P1, P2 connecting line is proportionally changed from C1 to C2. Any point P not on the extended P1, P2 connecting line has the color of the point P' that is the perpendicular projection of P on the extended P1, P2 connecting line. Points on the extended line outside of the P1, P2 segment can be colored in one of two ways.
- If the gradient is cyclic then the points on the extended P1, P2 connecting line cycle back and forth between the colors C1 and C2.
- If the gradient is acyclic then points on the P1 side of the segment have the constant
Color
C1 while points on the P2 side have the constant Color
C2.
@see Paint
@see Graphics2D#setPaint
@version 10 Feb 1997