Record Class Color
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.color.Color
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Colorstatic final Colorstatic final com.mojang.serialization.Codec<Color> static final Colorstatic final Color[]static final Colorstatic final com.mojang.serialization.Codec<Color> static final Colorstatic final Colorstatic final com.mojang.serialization.Codec<Color> static final com.mojang.serialization.Codec<Color> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Color> static final com.mojang.serialization.Codec<Color> static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Color> static final com.mojang.serialization.Codec<Color> static final com.mojang.serialization.Codec<Color> static final Colorstatic final Colorstatic final Color -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintabgr()intalpha()floatalphaf()intargb()Returns the value of theargbrecord component.intblue()floatbluef()final booleanIndicates whether some other object is "equal to" this one.fadeOut(float time, float maxTime, float fadeOut) floatgetHue()intgreen()floatgreenf()inthashCode()Returns a hash code value for this object.static Colorhsb(float hue, float saturation, float brightness, int alpha) booleanmixAlpha(float alpha) mixAlpha(int alpha) static Colorof(float a, float r, float g, float b) static Colorof(int argb) static Colorof(int r, int g, int b) static Colorof(int a, int r, int g, int b) static ColorofRGB(int rgb) intred()floatredf()intrgb()solid()float[]toHSB(float[] hsb) toString()Returns a string representation of this record class.withAlpha(float alpha) withAlpha(int alpha)
-
Field Details
-
EMPTY_ARRAY
-
TRANSPARENT
-
WHITE
-
BLACK
-
RED
-
GREEN
-
BLUE
-
YELLOW
-
MAGENTA
-
CYAN
-
STRING_CODEC
-
INT_CODEC
-
SOLID_INT_CODEC
-
CODEC
-
SOLID_CODEC
-
TO_INT_CODEC
-
SOLID_TO_INT_CODEC
-
STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Color> STREAM_CODEC -
SOLID_STREAM_CODEC
public static final net.minecraft.network.codec.StreamCodec<io.netty.buffer.ByteBuf, Color> SOLID_STREAM_CODEC -
DATA_TYPE
-
SOLID_DATA_TYPE
-
-
Constructor Details
-
Color
public Color(int argb) Creates an instance of aColorrecord class.- Parameters:
argb- the value for theargbrecord component
-
-
Method Details
-
of
-
ofRGB
-
of
-
of
-
of
-
hsb
-
rgb
public int rgb() -
alpha
public int alpha() -
red
public int red() -
green
public int green() -
blue
public int blue() -
alphaf
public float alphaf() -
redf
public float redf() -
greenf
public float greenf() -
bluef
public float bluef() -
withAlpha
-
withAlpha
-
mixAlpha
-
mixAlpha
-
fadeOut
-
hashCode
-
toRGBString
-
toARGBString
-
toString
-
lerp
-
lerp
-
isTransparent
public boolean isTransparent() -
solid
-
transparent
-
toOptionalARGB
-
toOptionalRGB
-
abgr
public int abgr() -
getHue
public float getHue() -
toHSB
public float[] toHSB(float[] hsb) -
toGradient
-
gradient
-
gradient
-
mix
-
mix
-
mix
-
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
-