Record Class HslColor
java.lang.Object
java.lang.Record
io.github.pylonmc.pylon.base.util.HslColor
-
Constructor Summary
ConstructorsConstructorDescriptionHslColor(double hue, double saturation, double lightness) Creates an instance of aHslColorrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.static @NotNull HslColorfromRgb(@NotNull org.bukkit.Color color) final inthashCode()Returns a hash code value for this object.doublehue()Returns the value of thehuerecord component.doubleReturns the value of thelightnessrecord component.doubleReturns the value of thesaturationrecord component.@NotNull org.bukkit.ColortoRgb()final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
HslColor
public HslColor(double hue, double saturation, double lightness) Creates an instance of aHslColorrecord class.- Parameters:
hue- the value for thehuerecord componentsaturation- the value for thesaturationrecord componentlightness- the value for thelightnessrecord component
-
-
Method Details
-
fromRgb
-
toRgb
@NotNull public @NotNull org.bukkit.Color toRgb() -
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 '=='. -
hue
public double hue()Returns the value of thehuerecord component.- Returns:
- the value of the
huerecord component
-
saturation
public double saturation()Returns the value of thesaturationrecord component.- Returns:
- the value of the
saturationrecord component
-
lightness
public double lightness()Returns the value of thelightnessrecord component.- Returns:
- the value of the
lightnessrecord component
-