Package top.untold.frostlumen.core.data
Record Class RGBA
java.lang.Object
java.lang.Record
top.untold.frostlumen.core.data.RGBA
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRGBA(int red, int green, int blue, int alpha) Creates an instance of aRGBArecord class. -
Method Summary
Modifier and TypeMethodDescriptionintalpha()Returns the value of thealpharecord component.intblue()Returns the value of thebluerecord component.final booleanIndicates whether some other object is "equal to" this one.floatfloatfloatfloatintgreen()Returns the value of thegreenrecord component.final inthashCode()Returns a hash code value for this object.intred()Returns the value of theredrecord component.intfinal StringtoString()Returns a string representation of this record class.withAlpha(int alpha) withBlue(int blue) withGreen(int green) withRed(int red) writeRGBAByteBuffer(ByteBuffer buffer)
-
Field Details
-
WHITE
-
BLACK
-
RED
-
GREEN
-
BLUE
-
GRAY
-
TRANSPARENT
-
-
Constructor Details
-
RGBA
public RGBA(int red, int green, int blue, int alpha) Creates an instance of aRGBArecord class.- Parameters:
red- the value for theredrecord componentgreen- the value for thegreenrecord componentblue- the value for thebluerecord componentalpha- the value for thealpharecord component
-
-
Method Details
-
getRedFloat
public float getRedFloat() -
getGreenFloat
public float getGreenFloat() -
getBlueFloat
public float getBlueFloat() -
getAlphaFloat
public float getAlphaFloat() -
withRed
-
withGreen
-
withBlue
-
withAlpha
-
toARGBInt
public int toARGBInt() -
writeRGBAByteBuffer
-
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 '=='. -
red
public int red()Returns the value of theredrecord component.- Returns:
- the value of the
redrecord component
-
green
public int green()Returns the value of thegreenrecord component.- Returns:
- the value of the
greenrecord component
-
blue
public int blue()Returns the value of thebluerecord component.- Returns:
- the value of the
bluerecord component
-
alpha
public int alpha()Returns the value of thealpharecord component.- Returns:
- the value of the
alpharecord component
-