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

    Constructors
    Constructor
    Description
    RadialGradient(float cx, float cy, float radius, Color center, Color edge)
    Creates an instance of a RadialGradient record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the center record component.
    float
    cx()
    Returns the value of the cx record component.
    float
    cy()
    Returns the value of the cy record component.
    Returns the value of the edge record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    float
    Returns the value of the radius record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • RadialGradient

      public RadialGradient(float cx, float cy, float radius, Color center, Color edge)
      Creates an instance of a RadialGradient record class.
      Parameters:
      cx - the value for the cx record component
      cy - the value for the cy record component
      radius - the value for the radius record component
      center - the value for the center record component
      edge - the value for the edge record component
  • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • cx

      public float cx()
      Returns the value of the cx record component.
      Returns:
      the value of the cx record component
    • cy

      public float cy()
      Returns the value of the cy record component.
      Returns:
      the value of the cy record component
    • radius

      public float radius()
      Returns the value of the radius record component.
      Returns:
      the value of the radius record component
    • center

      public Color center()
      Returns the value of the center record component.
      Returns:
      the value of the center record component
    • edge

      public Color edge()
      Returns the value of the edge record component.
      Returns:
      the value of the edge record component