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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Matrix` | `getMatrix()` | Gets the matrix of this linear gradient.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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 vector
        `yStart` - the y-coordinate for the start of the gradient vector
        `xEnd` - the x-coordinate for the end of the gradient vector
        `yEnd` - the y-coordinate for the end of the gradient vector
        `colors` - the sRGB colors to be distributed along the gradient vector
        `positions` - 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 vector
        `yStart` - the y-coordinate for the start of the gradient vector
        `xEnd` - the x-coordinate for the end of the gradient vector
        `yEnd` - the y-coordinate for the end of the gradient vector
        `colors` - 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