public class LinearGradient extends Object
Constructor and Description |
---|
LinearGradient(float xStart,
float yStart,
float xEnd,
float yEnd,
int[] colors)
Creates a linear gradient.
|
LinearGradient(float xStart,
float yStart,
float xEnd,
float yEnd,
int[] colors,
float[] positions)
Creates a linear gradient.
|
public LinearGradient(float xStart, float yStart, float xEnd, float yEnd, int[] colors)
The colors are distributed evenly along the gradient vector.
xStart
- the x-coordinate for the start of the gradient vectoryStart
- the y-coordinate for the start of the gradient vectorxEnd
- the x-coordinate for the end of the gradient vectoryEnd
- the y-coordinate for the end of the gradient vectorcolors
- the sRGB colors to be distributed along the gradient vectorpublic LinearGradient(float xStart, float yStart, float xEnd, float yEnd, int[] colors, float[] positions)
xStart
- the x-coordinate for the start of the gradient vectoryStart
- the y-coordinate for the start of the gradient vectorxEnd
- the x-coordinate for the end of the gradient vectoryEnd
- the y-coordinate for the end of the gradient vectorcolors
- the sRGB colors to be distributed along the gradient vectorpositions
- the relative positions [0..1] of each corresponding color in the colors arraypublic Matrix getMatrix()
Any modification on the matrix will affect the gradient.