Record Class RenderColor
java.lang.Object
java.lang.Record
com.render.api.RenderColor
Immutable ARGB color value used across the public render API.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumNamed preset colors for common UI and world rendering use cases. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColorstatic final RenderColor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintalpha()intargb()Returns the value of theargbrecord component.static RenderColorargb(int argb) static RenderColorargb(int alpha, int red, int green, int blue) intblue()final booleanIndicates whether some other object is "equal to" this one.intgreen()final inthashCode()Returns a hash code value for this object.static RenderColorstatic RenderColorpreset(RenderColor.Preset preset) intred()static RenderColorrgb(float red, float green, float blue) static RenderColorrgb(int rgb) static RenderColorrgb(int red, int green, int blue) static RenderColorrgba(float red, float green, float blue, float alpha) static RenderColorrgba(int red, int green, int blue, int alpha) inttoArgb()final StringtoString()Returns a string representation of this record class.withAlpha(int alpha) withOpacity(float opacity)
-
Field Details
-
TRANSPARENT
-
BLACK
-
WHITE
-
RED
-
GREEN
-
BLUE
-
YELLOW
-
ORANGE
-
CYAN
-
MAGENTA
-
-
Constructor Details
-
RenderColor
public RenderColor(int argb) Creates an instance of aRenderColorrecord class.- Parameters:
argb- the value for theargbrecord component
-
-
Method Details
-
argb
-
rgb
-
argb
-
rgba
-
rgb
-
rgba
-
rgb
-
hex
-
preset
-
toArgb
public int toArgb() -
alpha
public int alpha() -
red
public int red() -
green
public int green() -
blue
public int blue() -
withAlpha
-
withOpacity
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
argb
public int argb()Returns the value of theargbrecord component.- Returns:
- the value of the
argbrecord component
-