Package org.bukkit
Class Color
java.lang.Object
org.bukkit.Color
- All Implemented Interfaces:
- ConfigurationSerializable
public final class Color extends Object implements ConfigurationSerializable
A container for a color palette. This class is immutable; the set methods
 return a new color. The color names listed as fields are HTML4 standards,
 but subject to change.
- 
Field SummaryFields Modifier and Type Field Description static ColorAQUAAqua, or (0x00,0xFF,0xFF) in (R,G,B)static ColorBLACKBlack, or (0x00,0x00,0x00) in (R,G,B)static ColorBLUEBlue, or (0x00,0x00,0xFF) in (R,G,B)static ColorFUCHSIAFuchsia, or (0xFF,0x00,0xFF) in (R,G,B)static ColorGRAYGray, or (0x80,0x80,0x80) in (R,G,B)static ColorGREENGreen, or (0x00,0x80,0x00) in (R,G,B)static ColorLIMELime, or (0x00,0xFF,0x00) in (R,G,B)static ColorMAROONMaroon, or (0x80,0x00,0x00) in (R,G,B)static ColorNAVYNavy, or (0x00,0x00,0x80) in (R,G,B)static ColorOLIVEOlive, or (0x80,0x80,0x00) in (R,G,B)static ColorORANGEOrange, or (0xFF,0xA5,0x00) in (R,G,B)static ColorPURPLEPurple, or (0x80,0x00,0x80) in (R,G,B)static ColorREDRed, or (0xFF,0x00,0x00) in (R,G,B)static ColorSILVERSilver, or (0xC0,0xC0,0xC0) in (R,G,B)static ColorTEALTeal, or (0x00,0x80,0x80) in (R,G,B)static ColorWHITEWhite, or (0xFF,0xFF,0xFF) in (R,G,B)static ColorYELLOWYellow, or (0xFF,0xFF,0x00) in (R,G,B)
- 
Method SummaryModifier and Type Method Description intasBGR()Gets the color as an BGR integer.intasRGB()Gets the color as an RGB integer.static Colordeserialize(Map<String,Object> map)booleanequals(Object o)static ColorfromBGR(int bgr)Creates a new color object from an integer that contains the blue, green, and red bytes in the lowest order 24 bits.static ColorfromBGR(int blue, int green, int red)Creates a new Color object from a blue, green, and redstatic ColorfromRGB(int rgb)Creates a new color object from an integer that contains the red, green, and blue bytes in the lowest order 24 bits.static ColorfromRGB(int red, int green, int blue)Creates a new Color object from a red, green, and blueintgetBlue()Gets the blue componentintgetGreen()Gets the green componentintgetRed()Gets the red componentinthashCode()ColormixColors(Color... colors)Creates a new color with its RGB components changed as if it was dyed with the colors passed in, replicating vanilla workbench dyeingColormixDyes(DyeColor... colors)Creates a new color with its RGB components changed as if it was dyed with the colors passed in, replicating vanilla workbench dyeingMap<String,Object>serialize()Creates a Map representation of this class.ColorsetBlue(int blue)Creates a new Color object with specified componentColorsetGreen(int green)Creates a new Color object with specified componentColorsetRed(int red)Creates a new Color object with specified componentStringtoString()
- 
Field Details- 
WHITEWhite, or (0xFF,0xFF,0xFF) in (R,G,B)
- 
SILVERSilver, or (0xC0,0xC0,0xC0) in (R,G,B)
- 
GRAYGray, or (0x80,0x80,0x80) in (R,G,B)
- 
BLACKBlack, or (0x00,0x00,0x00) in (R,G,B)
- 
REDRed, or (0xFF,0x00,0x00) in (R,G,B)
- 
MAROONMaroon, or (0x80,0x00,0x00) in (R,G,B)
- 
YELLOWYellow, or (0xFF,0xFF,0x00) in (R,G,B)
- 
OLIVEOlive, or (0x80,0x80,0x00) in (R,G,B)
- 
LIMELime, or (0x00,0xFF,0x00) in (R,G,B)
- 
GREENGreen, or (0x00,0x80,0x00) in (R,G,B)
- 
AQUAAqua, or (0x00,0xFF,0xFF) in (R,G,B)
- 
TEALTeal, or (0x00,0x80,0x80) in (R,G,B)
- 
BLUEBlue, or (0x00,0x00,0xFF) in (R,G,B)
- 
NAVYNavy, or (0x00,0x00,0x80) in (R,G,B)
- 
FUCHSIAFuchsia, or (0xFF,0x00,0xFF) in (R,G,B)
- 
PURPLEPurple, or (0x80,0x00,0x80) in (R,G,B)
- 
ORANGEOrange, or (0xFF,0xA5,0x00) in (R,G,B)
 
- 
- 
Method Details- 
fromRGBCreates a new Color object from a red, green, and blue- Parameters:
- red- integer from 0-255
- green- integer from 0-255
- blue- integer from 0-255
- Returns:
- a new Color object for the red, green, blue
- Throws:
- IllegalArgumentException- if any value is strictly >255 or <0
 
- 
fromBGRCreates a new Color object from a blue, green, and red- Parameters:
- blue- integer from 0-255
- green- integer from 0-255
- red- integer from 0-255
- Returns:
- a new Color object for the red, green, blue
- Throws:
- IllegalArgumentException- if any value is strictly >255 or <0
 
- 
fromRGBCreates a new color object from an integer that contains the red, green, and blue bytes in the lowest order 24 bits.- Parameters:
- rgb- the integer storing the red, green, and blue values
- Returns:
- a new color object for specified values
- Throws:
- IllegalArgumentException- if any data is in the highest order 8 bits
 
- 
fromBGRCreates a new color object from an integer that contains the blue, green, and red bytes in the lowest order 24 bits.- Parameters:
- bgr- the integer storing the blue, green, and red values
- Returns:
- a new color object for specified values
- Throws:
- IllegalArgumentException- if any data is in the highest order 8 bits
 
- 
getRedpublic int getRed()Gets the red component- Returns:
- red component, from 0 to 255
 
- 
setRedCreates a new Color object with specified component- Parameters:
- red- the red component, from 0 to 255
- Returns:
- a new color object with the red component
 
- 
getGreenpublic int getGreen()Gets the green component- Returns:
- green component, from 0 to 255
 
- 
setGreenCreates a new Color object with specified component- Parameters:
- green- the red component, from 0 to 255
- Returns:
- a new color object with the red component
 
- 
getBluepublic int getBlue()Gets the blue component- Returns:
- blue component, from 0 to 255
 
- 
setBlueCreates a new Color object with specified component- Parameters:
- blue- the red component, from 0 to 255
- Returns:
- a new color object with the red component
 
- 
asRGBpublic int asRGB()Gets the color as an RGB integer.- Returns:
- An integer representation of this color, as 0xRRGGBB
 
- 
asBGRpublic int asBGR()Gets the color as an BGR integer.- Returns:
- An integer representation of this color, as 0xBBGGRR
 
- 
mixDyesCreates a new color with its RGB components changed as if it was dyed with the colors passed in, replicating vanilla workbench dyeing- Parameters:
- colors- The DyeColors to dye with
- Returns:
- A new color with the changed rgb components
 
- 
mixColorsCreates a new color with its RGB components changed as if it was dyed with the colors passed in, replicating vanilla workbench dyeing- Parameters:
- colors- The colors to dye with
- Returns:
- A new color with the changed rgb components
 
- 
equals
- 
hashCodepublic int hashCode()
- 
serializeDescription copied from interface:ConfigurationSerializableCreates a Map representation of this class.This class must provide a method to restore this class, as defined in the ConfigurationSerializableinterface javadocs.- Specified by:
- serializein interface- ConfigurationSerializable
- Returns:
- Map containing the current state of this class
 
- 
deserialize
- 
toString
 
-