Package net.createmod.catnip.theme
Class Color
java.lang.Object
net.createmod.catnip.theme.Color
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.network.chat.StyleasStyle()net.minecraft.world.phys.Vec3asVector()org.joml.Vector3fbrighter()copy()copy(boolean mutable) darker()static ColorgenerateFromLong(long l) intgetAlpha()floatintgetBlue()floatintgetGreen()floatintgetRed()floatintgetRGB()Returns the RGB value representing this color (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).static intmixColors(int color1, int color2, float w) static Colorstatic ColormodifyValue(UnaryOperator<Integer> function) static ColorrainbowColor(int timeStep) scaleAlpha(float factor) scaleAlphaForText(float factor) Mojang's Font renderer adjusts colors with alpha values below 5 to be a solid color instead.setAlpha(float a) setAlpha(int a) protected ColorsetAlphaUnchecked(int a) setBlue(float b) setBlue(int b) protected ColorsetBlueUnchecked(int b) setGreen(float g) setGreen(int g) protected ColorsetGreenUnchecked(int g) Mark this color as immutable.setRed(float r) setRed(int r) protected ColorsetRedUnchecked(int r) setValue(int value) protected ColorsetValueUnchecked(int value)
-
Field Details
-
TRANSPARENT_BLACK
-
BLACK
-
WHITE
-
RED
-
GREEN
-
PURPLE
-
SPRING_GREEN
-
mutable
protected boolean mutable -
value
protected int value
-
-
Constructor Details
-
Color
public Color(int r, int g, int b) -
Color
public Color(int r, int g, int b, int a) -
Color
public Color(float r, float g, float b, float a) -
Color
public Color(int argb) -
Color
public Color(int argb, boolean hasAlpha)
-
-
Method Details
-
copy
-
copy
-
setImmutable
Mark this color as immutable. Attempting to mutate this color in the future will instead cause a copy to be created that can me modified. -
getRed
public int getRed()- Returns:
- the red component in the range 0-255.
- See Also:
-
getGreen
public int getGreen()- Returns:
- the green component in the range 0-255.
- See Also:
-
getBlue
public int getBlue()- Returns:
- the blue component in the range 0-255.
- See Also:
-
getAlpha
public int getAlpha()- Returns:
- the alpha component in the range 0-255.
- See Also:
-
getRedAsFloat
public float getRedAsFloat()- Returns:
- the red component in the range 0-1f.
-
getGreenAsFloat
public float getGreenAsFloat()- Returns:
- the green component in the range 0-1f.
-
getBlueAsFloat
public float getBlueAsFloat()- Returns:
- the blue component in the range 0-1f.
-
getAlphaAsFloat
public float getAlphaAsFloat()- Returns:
- the alpha component in the range 0-1f.
-
getRGB
public int getRGB()Returns the RGB value representing this color (Bits 24-31 are alpha, 16-23 are red, 8-15 are green, 0-7 are blue).- Returns:
- the RGB value of the color
-
asVector
public net.minecraft.world.phys.Vec3 asVector() -
asVectorF
public org.joml.Vector3f asVectorF() -
asStyle
public net.minecraft.network.chat.Style asStyle() -
setRed
-
setGreen
-
setBlue
-
setAlpha
-
setRed
-
setGreen
-
setBlue
-
setAlpha
-
scaleAlpha
-
scaleAlphaForText
Mojang's Font renderer adjusts colors with alpha values below 5 to be a solid color instead. This method prevents the scaling to go below this threshold -
mixWith
-
darker
-
brighter
-
setValue
-
modifyValue
-
ensureMutable
-
setRedUnchecked
-
setGreenUnchecked
-
setBlueUnchecked
-
setAlphaUnchecked
-
setValueUnchecked
-
mixColors
-
mixColors
-
mixColors
public static int mixColors(int color1, int color2, float w) -
rainbowColor
-
generateFromLong
-