public class Color
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static Color |
BLACK |
static Color |
GREEN |
protected boolean |
mutable |
static Color |
RED |
static Color |
SPRING_GREEN |
static Color |
TRANSPARENT_BLACK |
protected int |
value |
static Color |
WHITE |
| Constructor and Description |
|---|
Color(float r,
float g,
float b,
float a) |
Color(int rgba) |
Color(int rgb,
boolean hasAlpha) |
Color(int r,
int g,
int b) |
Color(int r,
int g,
int b,
int a) |
| Modifier and Type | Method and Description |
|---|---|
Color |
applyAlpha(float alpha)
Deprecated.
|
net.minecraft.util.math.vector.Vector3d |
asVector() |
Color |
brighter() |
Color |
copy() |
Color |
copy(boolean mutable) |
Color |
darker() |
protected Color |
ensureMutable() |
static Color |
generateFromLong(long l) |
int |
getAlpha() |
float |
getAlphaAsFloat() |
int |
getBlue() |
float |
getBlueAsFloat() |
int |
getGreen() |
float |
getGreenAsFloat() |
int |
getRed() |
float |
getRedAsFloat() |
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).
|
static Color |
mixColors(Color c1,
Color c2,
float w) |
static Color |
mixColors(Couple<Color> colors,
float w) |
static int |
mixColors(int color1,
int color2,
float w) |
Color |
mixWith(Color other,
float weight) |
Color |
modifyValue(java.util.function.UnaryOperator<java.lang.Integer> function) |
static Color |
rainbowColor(int timeStep) |
Color |
scaleAlpha(float factor) |
Color |
setAlpha(float a) |
Color |
setAlpha(int a) |
protected Color |
setAlphaUnchecked(int a) |
Color |
setBlue(float b) |
Color |
setBlue(int b) |
protected Color |
setBlueUnchecked(int b) |
Color |
setGreen(float g) |
Color |
setGreen(int g) |
protected Color |
setGreenUnchecked(int g) |
Color |
setImmutable()
Mark this color as immutable.
|
Color |
setRed(float r) |
Color |
setRed(int r) |
protected Color |
setRedUnchecked(int r) |
Color |
setValue(int value) |
protected Color |
setValueUnchecked(int value) |
static net.minecraft.util.math.vector.Vector3d |
vectorFromRGB(int color)
Deprecated.
|
public static final Color TRANSPARENT_BLACK
public static final Color BLACK
public static final Color WHITE
public static final Color RED
public static final Color GREEN
public static final Color SPRING_GREEN
protected boolean mutable
protected int value
public Color(int r,
int g,
int b)
public Color(int r,
int g,
int b,
int a)
public Color(float r,
float g,
float b,
float a)
public Color(int rgba)
public Color(int rgb,
boolean hasAlpha)
public Color copy()
public Color copy(boolean mutable)
public Color setImmutable()
public int getRed()
getRGB()public int getGreen()
getRGB()public int getBlue()
getRGB()public int getAlpha()
getRGB()public float getRedAsFloat()
public float getGreenAsFloat()
public float getBlueAsFloat()
public float getAlphaAsFloat()
public int getRGB()
public net.minecraft.util.math.vector.Vector3d asVector()
public Color setRed(int r)
public Color setGreen(int g)
public Color setBlue(int b)
public Color setAlpha(int a)
public Color setRed(float r)
public Color setGreen(float g)
public Color setBlue(float b)
public Color setAlpha(float a)
public Color scaleAlpha(float factor)
@Deprecated public Color applyAlpha(float alpha)
public Color darker()
public Color brighter()
public Color setValue(int value)
public Color modifyValue(java.util.function.UnaryOperator<java.lang.Integer> function)
protected Color ensureMutable()
protected Color setRedUnchecked(int r)
protected Color setGreenUnchecked(int g)
protected Color setBlueUnchecked(int b)
protected Color setAlphaUnchecked(int a)
protected Color setValueUnchecked(int value)
public static int mixColors(int color1,
int color2,
float w)
public static Color rainbowColor(int timeStep)
public static Color generateFromLong(long l)
@Deprecated public static net.minecraft.util.math.vector.Vector3d vectorFromRGB(int color)