Package ej.microvg
Class LinearGradient
- java.lang.Object
-
- ej.microvg.LinearGradient
-
public class LinearGradient extends Object
Represents a linear gradient on a vector.
-
-
Constructor Summary
Constructors Constructor 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.
-
-
-
Constructor Detail
-
LinearGradient
public LinearGradient(float xStart, float yStart, float xEnd, float yEnd, int[] colors, float[] positions)Creates a linear gradient.- Parameters:
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 array
-
LinearGradient
public LinearGradient(float xStart, float yStart, float xEnd, float yEnd, int[] colors)Creates a linear gradient.The colors are distributed evenly along the gradient vector.
- Parameters:
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 vector
-
-
Method Detail
-
getMatrix
public Matrix getMatrix()
Gets the matrix of this linear gradient.Any modification on the matrix will affect the gradient.
- Returns:
- the matrix
-
-