public class ColorObject
extends java.lang.Object
| Constructor and Description |
|---|
ColorObject()
Constructs a new ColorObject that is pure white and fully visible.
|
ColorObject(boolean doAlpha)
Constructs a new ColorObject with completely random values for RGBA.
|
ColorObject(io.netty.buffer.ByteBuf buf)
Constructs a new ColorObject from a ByteBuf.
|
ColorObject(java.awt.Color color)
Constructs a new ColorObject from an AWT Color.
|
ColorObject(float red,
float green,
float blue)
Creates a new ColorObject using the standard RGB color values.
|
ColorObject(float red,
float green,
float blue,
float alpha)
Creates a new ColorObject using the standard RGBA color values.
|
ColorObject(int rgb)
Converts a decimal color integer like the one produced in getIntFromColor back into a
ColorObject.
|
ColorObject(int red,
int green,
int blue)
Creates a new ColorObject using integers which will be converted back into floats.
|
ColorObject(int red,
int green,
int blue,
int alpha)
Creates a new ColorObject using integers which will be converted back into floats.
|
ColorObject(net.minecraft.nbt.NBTTagCompound tag)
Constructs a new ColorObject from a NBTTagCompound.
|
| Modifier and Type | Method and Description |
|---|---|
ColorObject |
copy()
Creates a copy of the provided ColorObject, useful when you don't want to mess up
existing instances.
|
boolean |
equals(java.lang.Object obj) |
float |
getAlpha()
Retrieves the transparency value from this color object.
|
float |
getBlue()
Retrieves the blue value from this color object.
|
float |
getGreen()
Retrieves the green value from this color object.
|
int |
getIntFromColor()
Converts a ColorObject to a decimal color value.
|
static float |
getRandomColor()
Creates a random float value which represents a color.
|
float |
getRed()
Retrieves the red value from this color object.
|
net.minecraft.nbt.NBTTagCompound |
getTagFromColor()
Creates a new NBTTagCompound from a ColorObject.
|
boolean |
isGeneric(float color)
A method which can be used to check if a ColorObject is generic.
|
boolean |
isGenericWhite()
A simple method used to check if a ColorObject is generic.
|
void |
setAlpha(float amount)
Sets the transparency value for this color object.
|
void |
setBlue(float amount)
Sets the blue value for this color object.
|
void |
setGreen(float amount)
Sets the green value for this color object.
|
void |
setRed(float amount)
Sets the red value for this color object.
|
java.lang.String |
toString() |
void |
writeToBuffer(io.netty.buffer.ByteBuf buf)
Writes the ColorObject to a ByteBuf.
|
net.minecraft.item.ItemStack |
writeToItemStack(net.minecraft.item.ItemStack stack)
A basic wrapper method that handles the creation of new ItemStacks.
|
net.minecraft.nbt.NBTTagCompound |
writeToTag(net.minecraft.nbt.NBTTagCompound tag)
Writes the data contained within the ColorObject to the provided NBTTagCompound.
|
public ColorObject()
public ColorObject(io.netty.buffer.ByteBuf buf)
buf: - The ByteBuf to pull the data from.public ColorObject(java.awt.Color color)
color: - The AWT Color to pull the RGB from.public ColorObject(boolean doAlpha)
doAlpha - : If true, the alpha value will also be randomized, by default it is 1.public ColorObject(net.minecraft.nbt.NBTTagCompound tag)
tag: - An NBTTagCompound which should have color data written to it.public ColorObject(int rgb)
rgb - : The decimal value which represents all of the color data.public ColorObject(int red,
int green,
int blue)
red - : The amount of red that makes up this color.green - : The amount of green that makes up this color.blue - : The amount of blue that makes up this color.public ColorObject(int red,
int green,
int blue,
int alpha)
red - : The amount of red that makes up this color.green - : The amount of green that makes up this color.blue - : The amount of blue that makes up this color.alpha - : The transparency for this color. 0 is fully transparent, while 100 is
completely solid.public ColorObject(float red,
float green,
float blue)
red - : The amount of red that makes up this color.green - : The amount of green that makes up this color.blue - : The amount of blue that makes up this color.public ColorObject(float red,
float green,
float blue,
float alpha)
red - : The amount of that makes up this color.green - : The amount of that makes up this color.blue - : The amount of that makes up this color.alpha - : The transparency of this color object. 0 is completely see through, 1 is
completely solid.public void setRed(float amount)
amount: - The amount of red to set the value at. 0.0f -> 1.0fpublic float getRed()
public void setGreen(float amount)
amount: - The amount of green to set the value at. 0.0f -> 1.0fpublic float getGreen()
public void setBlue(float amount)
amount: - The amount of blue to set the value at. 0.0f -> 1.0fpublic float getBlue()
public void setAlpha(float amount)
amount: - The amount of alpha to set the value at. 0.0f -> 1.0fpublic float getAlpha()
public net.minecraft.nbt.NBTTagCompound getTagFromColor()
public int getIntFromColor()
public static float getRandomColor()
public boolean isGenericWhite()
public boolean isGeneric(float color)
color - : The value of the color being checked for the RGB.public ColorObject copy()
public net.minecraft.nbt.NBTTagCompound writeToTag(net.minecraft.nbt.NBTTagCompound tag)
tag: - An NBTTagCompound used to write data to. If null is provided, one will be
generated for you.public net.minecraft.item.ItemStack writeToItemStack(net.minecraft.item.ItemStack stack)
stack: - The ItemStack you wish to write to.public void writeToBuffer(io.netty.buffer.ByteBuf buf)
buf: - The ByteBuf to write the ColorObject into.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object