Package dev.upcraft.sparkweave.api.color
Class Color
java.lang.Object
dev.upcraft.sparkweave.api.color.Color
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<Color> static final com.mojang.serialization.Codec<Color> static final Color.Ordering -
Method Summary
Modifier and TypeMethodDescriptionintalpha()floatalphaF()float[]asFloats(Color.Ordering ordering) float[]intasInt(Color.Ordering ordering) intorg.joml.Vector4fcasVec()org.joml.Vector3fcasVec3()intblue()floatblueF()static ColorfromARGB(int argb) static ColorfromFloatArray(Color.Ordering ordering, float... values) static ColorfromFloatsRGB(float red, float green, float blue) static ColorfromFloatsRGBA(float red, float green, float blue, float alpha) static ColorfromHSV(float hue, float saturation, float value) HSV (hue, saturation, value), also known as HSB (hue, saturation, brightness)static ColorfromInt(int intValue, Color.Ordering ordering) static ColorfromIntArray(Color.Ordering ordering, int... values) static ColorfromRGB(int red, int green, int blue) intgreen()floatgreenF()intplaceAt(int value, int length, int idx) intred()floatredF()
-
Field Details
-
DEFAULT_ORDERING
-
CODEC_ARGB
-
CODEC
-
-
Method Details
-
fromRGB
-
fromFloatsRGBA
-
fromFloatsRGB
-
fromIntArray
-
fromFloatArray
-
red
public int red() -
redF
public float redF() -
green
public int green() -
greenF
public float greenF() -
blue
public int blue() -
blueF
public float blueF() -
alpha
public int alpha() -
alphaF
public float alphaF() -
asFloatsRGBA
public float[] asFloatsRGBA() -
asFloats
-
asIntARGB
public int asIntARGB() -
asInt
-
asVec
public org.joml.Vector4fc asVec() -
asVec3
public org.joml.Vector3fc asVec3() -
fromInt
-
fromARGB
-
fromHSV
HSV (hue, saturation, value), also known as HSB (hue, saturation, brightness)- Parameters:
hue- angle as [0, 1], where 1.0 means a full circle and overflows back to 0.0saturation- saturation in [0, 1]value- brightness in [0, 1]
-
placeAt
public int placeAt(int value, int length, int idx)
-