Record Class ElevationShadow

java.lang.Object
java.lang.Record
limn.components.ElevationShadow
Record Components:
keyOffset - how far below the surface the key layer lies, in points
keyBlur - the key layer's soft edge
keyOpacity - how dark the key layer is, from 0 to 1
ambientBlur - the ambient layer's soft edge
ambientOpacity - how dark the ambient layer is, from 0 to 1

public record ElevationShadow(float keyOffset, float keyBlur, float keyOpacity, float ambientBlur, float ambientOpacity) extends Record
The shadow of one Elevation in a theme: two layers straight down, since the light is above. The key layer is offset and wide, and says how far the surface is lifted; the ambient layer is tight and sits under the surface's own edge, where it keeps the edge when the key layer has faded.
  • Field Details

    • NONE

      public static final ElevationShadow NONE
      No shadow: what Elevation.FLAT has in every theme.
    • MAX_POINTS

      public static final float MAX_POINTS
      The most a number of a shadow may be, in points: past it a shadow is a fog.
      See Also:
  • Constructor Details

    • ElevationShadow

      public ElevationShadow(float keyOffset, float keyBlur, float keyOpacity, float ambientBlur, float ambientOpacity)
      Creates an instance of a ElevationShadow record class.
      Parameters:
      keyOffset - the value for the keyOffset record component
      keyBlur - the value for the keyBlur record component
      keyOpacity - the value for the keyOpacity record component
      ambientBlur - the value for the ambientBlur record component
      ambientOpacity - the value for the ambientOpacity record component
  • Method Details

    • isNone

      public boolean isNone()
      Returns:
      whether nothing is drawn for this
    • layers

      public List<Shadow> layers()
      Returns:
      the layers to draw, the wide one first; empty for none
    • reach

      public float reach()
      Returns:
      how far past the surface's box the shadow can leave ink
    • 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 '=='.
      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.
    • keyOffset

      public float keyOffset()
      Returns the value of the keyOffset record component.
      Returns:
      the value of the keyOffset record component
    • keyBlur

      public float keyBlur()
      Returns the value of the keyBlur record component.
      Returns:
      the value of the keyBlur record component
    • keyOpacity

      public float keyOpacity()
      Returns the value of the keyOpacity record component.
      Returns:
      the value of the keyOpacity record component
    • ambientBlur

      public float ambientBlur()
      Returns the value of the ambientBlur record component.
      Returns:
      the value of the ambientBlur record component
    • ambientOpacity

      public float ambientOpacity()
      Returns the value of the ambientOpacity record component.
      Returns:
      the value of the ambientOpacity record component