# Record Class SyPaintGradientLinear

java.lang.Object
java.lang.Record
com.io7m.jsycamore.api.rendering.SyPaintGradientLinear

Record Components:
  `point0` - The start point
  `point1` - The end point
  `colors` - The color points
  `distribution` - The point distribution

All Implemented Interfaces:
  `SyPaintEdgeType, SyPaintFillType, SyPaintType`

public record SyPaintGradientLinear(com.io7m.jtensors.core.unparameterized.vectors.Vector2D point0, com.io7m.jtensors.core.unparameterized.vectors.Vector2D point1, List<com.io7m.jtensors.core.parameterized.vectors.PVector4D<SySpaceRGBAPreType>> colors, List<Double> distribution) extends Record implements SyPaintFillType, SyPaintEdgeType

The specification of a gradient.

A gradient is specified as a pair of points inside the unit square with the top left corner at `(0,0)` and the bottom right at `(1,1)`, and a list of colors with associated distribution values.

Distribution values denote how colors are distributed across the unit square. There must be the same number of distribution values as colors. With three colors `(a,b,c)`, and the distribution values `(0.0,0.5,1.0)`, the color `a` will be blended into `b` and `b` into `c` with `b` positioned exactly in the middle of `a` and `c`. Typically, the list of distribution values will sum to `1.0`, but this is not a hard requirement.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `SyPaintGradientLinear(com.io7m.jtensors.core.unparameterized.vectors.Vector2D point0, com.io7m.jtensors.core.unparameterized.vectors.Vector2D point1, List<com.io7m.jtensors.core.parameterized.vectors.PVector4D<SySpaceRGBAPreType>> colors, List<Double> distribution)`
  The specification of a gradient.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `List<com.io7m.jtensors.core.parameterized.vectors.PVector4D<SySpaceRGBAPreType>>`
  `colors()`
  Returns the value of the `colors` record component.
  `List<Double>`
  `distribution()`
  Returns the value of the `distribution` record component.
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `com.io7m.jtensors.core.unparameterized.vectors.Vector2D`
  `point0()`
  Returns the value of the `point0` record component.
  `com.io7m.jtensors.core.unparameterized.vectors.Vector2D`
  `point1()`
  Returns the value of the `point1` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.

  ### Methods inherited from class Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Constructor Details

  - ### SyPaintGradientLinear

    public SyPaintGradientLinear(com.io7m.jtensors.core.unparameterized.vectors.Vector2D point0, com.io7m.jtensors.core.unparameterized.vectors.Vector2D point1, List<com.io7m.jtensors.core.parameterized.vectors.PVector4D<SySpaceRGBAPreType>> colors, List<Double> distribution)

    The specification of a gradient.

    Parameters:
      `point0` - The start point
      `point1` - The end point
      `colors` - The color points
      `distribution` - The point distribution

- ## Method Details

  - ### toString

    public final String toString()
    Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
    Specified by:
      `toString` in class `Record`
    Returns:
      a string representation of this object

  - ### hashCode

    public final int hashCode()
    Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
    Specified by:
      `hashCode` in class `Record`
    Returns:
      a hash code value for this object

  - ### equals

    public final boolean equals(Object o)
    Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with `Objects::equals(Object,Object)`.
    Specified by:
      `equals` in class `Record`
    Parameters:
      `o` - the object with which to compare
    Returns:
      `true` if this object is the same as the `o` argument; `false` otherwise.

  - ### point0

    public com.io7m.jtensors.core.unparameterized.vectors.Vector2D point0()
    Returns the value of the `point0` record component.
    Returns:
      the value of the `point0` record component

  - ### point1

    public com.io7m.jtensors.core.unparameterized.vectors.Vector2D point1()
    Returns the value of the `point1` record component.
    Returns:
      the value of the `point1` record component

  - ### colors

    public List<com.io7m.jtensors.core.parameterized.vectors.PVector4D<SySpaceRGBAPreType>> colors()
    Returns the value of the `colors` record component.
    Returns:
      the value of the `colors` record component

  - ### distribution

    public List<Double> distribution()
    Returns the value of the `distribution` record component.
    Returns:
      the value of the `distribution` record component