Package limn.components
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 pointskeyBlur- the key layer's soft edgekeyOpacity- how dark the key layer is, from 0 to 1ambientBlur- the ambient layer's soft edgeambientOpacity- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final floatThe most a number of a shadow may be, in points: past it a shadow is a fog.static final ElevationShadowNo shadow: whatElevation.FLAThas in every theme. -
Constructor Summary
ConstructorsConstructorDescriptionElevationShadow(float keyOffset, float keyBlur, float keyOpacity, float ambientBlur, float ambientOpacity) Creates an instance of aElevationShadowrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatReturns the value of theambientBlurrecord component.floatReturns the value of theambientOpacityrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisNone()floatkeyBlur()Returns the value of thekeyBlurrecord component.floatReturns the value of thekeyOffsetrecord component.floatReturns the value of thekeyOpacityrecord component.layers()floatreach()final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
No shadow: whatElevation.FLAThas in every theme. -
MAX_POINTS
public static final float MAX_POINTSThe 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 aElevationShadowrecord class.- Parameters:
keyOffset- the value for thekeyOffsetrecord componentkeyBlur- the value for thekeyBlurrecord componentkeyOpacity- the value for thekeyOpacityrecord componentambientBlur- the value for theambientBlurrecord componentambientOpacity- the value for theambientOpacityrecord component
-
-
Method Details
-
isNone
public boolean isNone()- Returns:
- whether nothing is drawn for this
-
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
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. All components in this record class are compared with '=='. -
keyOffset
public float keyOffset()Returns the value of thekeyOffsetrecord component.- Returns:
- the value of the
keyOffsetrecord component
-
keyBlur
public float keyBlur()Returns the value of thekeyBlurrecord component.- Returns:
- the value of the
keyBlurrecord component
-
keyOpacity
public float keyOpacity()Returns the value of thekeyOpacityrecord component.- Returns:
- the value of the
keyOpacityrecord component
-
ambientBlur
public float ambientBlur()Returns the value of theambientBlurrecord component.- Returns:
- the value of the
ambientBlurrecord component
-
ambientOpacity
public float ambientOpacity()Returns the value of theambientOpacityrecord component.- Returns:
- the value of the
ambientOpacityrecord component
-