Class Color
java.lang.Object
com.simibubi.create.foundation.utility.Color
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.phys.Vec3asVector()com.mojang.math.Vector3fbrighter()copy()copy(boolean mutable)darker()protected Colorstatic 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)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
-
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 rgba) -
Color
public Color(int rgb, 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:
getRGB()
-
getGreen
public int getGreen()- Returns:
- the green component in the range 0-255.
- See Also:
getRGB()
-
getBlue
public int getBlue()- Returns:
- the blue component in the range 0-255.
- See Also:
getRGB()
-
getAlpha
public int getAlpha()- Returns:
- the alpha component in the range 0-255.
- See Also:
getRGB()
-
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 com.mojang.math.Vector3f asVectorF() -
setRed
-
setGreen
-
setBlue
-
setAlpha
-
setRed
-
setGreen
-
setBlue
-
setAlpha
-
scaleAlpha
-
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
-