Given parameters for creating a LinearGradientPaint, this method will create and return a linear gradient paint. One primary purpose for this method is to avoid creating a LinearGradientPaint where the start and end points are equal. In such a case, the end y point is slightly increased to avoid the overlap.
x1 | ||
y1 | ||
x2 | ||
y2 | ||
midpoints | ||
colors |
NullPointerException
| if midpoints array is null,
or colors array is null, | |
IllegalArgumentException
| if start and end points are the same points,
or midpoints.length != colors.length ,
or colors is less than 2 in size,
or a midpoints value is less than 0.0 or greater than 1.0,
or the midpoints are not provided in strictly increasing order |
Diagram: nimbus