protected final LinearGradientPaint decodeGradient (float x1, float y1, float x2, float y2, float[] midpoints, Color[] colors)

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.

Parameters:
x1   
y1   
x2   
y2   
midpoints   
colors   

Returns:  a valid LinearGradientPaint. This method never returns null.

Exceptions:
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