Package limn.graphics
Record Class RadialGradient
java.lang.Object
java.lang.Record
limn.graphics.RadialGradient
- All Implemented Interfaces:
Paint
public record RadialGradient(float cx, float cy, float radius, Color center, Color edge)
extends Record
implements Paint
Two-stop radial gradient:
center color at (cx,cy) fading to
edge color at distance radius, clamped beyond it. Points are
in the same logical coordinate space as the shape being painted.-
Constructor Summary
ConstructorsConstructorDescriptionRadialGradient(float cx, float cy, float radius, Color center, Color edge) Creates an instance of aRadialGradientrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncenter()Returns the value of thecenterrecord component.floatcx()Returns the value of thecxrecord component.floatcy()Returns the value of thecyrecord component.edge()Returns the value of theedgerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatradius()Returns the value of theradiusrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
RadialGradient
Creates an instance of aRadialGradientrecord class.- Parameters:
cx- the value for thecxrecord componentcy- the value for thecyrecord componentradius- the value for theradiusrecord componentcenter- the value for thecenterrecord componentedge- the value for theedgerecord component
-
-
Method Details
-
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. -
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. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
cx
public float cx()Returns the value of thecxrecord component.- Returns:
- the value of the
cxrecord component
-
cy
public float cy()Returns the value of thecyrecord component.- Returns:
- the value of the
cyrecord component
-
radius
public float radius()Returns the value of theradiusrecord component.- Returns:
- the value of the
radiusrecord component
-
center
Returns the value of thecenterrecord component.- Returns:
- the value of the
centerrecord component
-
edge
Returns the value of theedgerecord component.- Returns:
- the value of the
edgerecord component
-