Record Class SyPaintGradientLinear
java.lang.Object
java.lang.Record
com.io7m.jsycamore.api.rendering.SyPaintGradientLinear
- Record Components:
point0- The start pointpoint1- The end pointcolors- The color pointsdistribution- 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
ConstructorsConstructorDescriptionSyPaintGradientLinear(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 TypeMethodDescriptionList<com.io7m.jtensors.core.parameterized.vectors.PVector4D<SySpaceRGBAPreType>> colors()Returns the value of thecolorsrecord component.Returns the value of thedistributionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.io7m.jtensors.core.unparameterized.vectors.Vector2Dpoint0()Returns the value of thepoint0record component.com.io7m.jtensors.core.unparameterized.vectors.Vector2Dpoint1()Returns the value of thepoint1record component.final StringtoString()Returns a string representation of this record class.
-
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 pointpoint1- The end pointcolors- The color pointsdistribution- The point distribution
-
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
point0
-
point1
-
colors
-
distribution
Returns the value of thedistributionrecord component.- Returns:
- the value of the
distributionrecord component
-