public final class Color extends java.lang.Object implements ConfigurationSerializable
限定符和类型 | 字段和说明 |
---|---|
static Color |
AQUA
浅绿,或(R,G,B) 表示为 0x00,0xFF,0xFF)
|
static Color |
BLACK
黑色,或(R,G,B) 表示为 0x00,0x00,0x00)
|
static Color |
BLUE
蓝色,或(R,G,B) 表示为 0x00,0x00,0xFF)
|
static Color |
FUCHSIA
樱红色,或(R,G,B) 表示为 0xFF,0x00,0xFF)
|
static Color |
GRAY
灰色,或(R,G,B) 表示为 0x80,0x80,0x80)
|
static Color |
GREEN
绿色,或(R,G,B) 表示为 0x00,0x80,0x00)
|
static Color |
LIME
黄绿色,或(R,G,B) 表示为 0x00,0xFF,0x00)
|
static Color |
MAROON
栗色,或(R,G,B) 表示为 0x80,0x00,0x00)
|
static Color |
NAVY
海军色,或(R,G,B) 表示为 0x00,0x00,0x80)
|
static Color |
OLIVE
橄榄色,或(R,G,B) 表示为 0x80,0x80,0x00)
|
static Color |
ORANGE
橙色,或(R,G,B) 表示为 0xFF,0xA5,0x00)
|
static Color |
PURPLE
紫色,或(R,G,B) 表示为 0x80,0x00,0x80)
|
static Color |
RED
红色,或(R,G,B) 表示为 0xFF,0x00,0x00)
|
static Color |
SILVER
银色,或(R,G,B) 表示为 0xC0,0xC0,0xC0)
|
static Color |
TEAL
蓝绿色,或(R,G,B) 表示为 0x00,0x80,0x80)
|
static Color |
WHITE
白色,或(R,G,B) 表示为 0xFF,0xFF,0xFF)
|
static Color |
YELLOW
黄色,或(R,G,B) 表示为 0xFF,0xFF,0x00)
|
限定符和类型 | 方法和说明 |
---|---|
int |
asBGR() |
int |
asRGB() |
static Color |
deserialize(java.util.Map<java.lang.String,java.lang.Object> map) |
boolean |
equals(java.lang.Object o) |
static Color |
fromBGR(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 Color |
fromBGR(int blue,
int green,
int red)
用 蓝,绿,红 创建一个新的颜色对象
|
static Color |
fromRGB(int rgb)
从一个RGB整数中创建一个新的颜色对象,该对象包含最低24bits
|
static Color |
fromRGB(int red,
int green,
int blue)
用 红,绿,蓝 创建一个新的颜色对象
|
int |
getBlue()
Gets the blue component
|
int |
getGreen()
Gets the green component
|
int |
getRed()
Gets the red component
|
int |
hashCode() |
Color |
mixColors(Color... colors)
Creates a new color with its RGB components changed as if it was dyed
with the colors passed in, replicating vanilla workbench dyeing
|
Color |
mixDyes(DyeColor... colors)
Creates a new color with its RGB components changed as if it was dyed
with the colors passed in, replicating vanilla workbench dyeing
|
java.util.Map<java.lang.String,java.lang.Object> |
serialize()
Creates a Map representation of this class.
|
Color |
setBlue(int blue)
Creates a new Color object with specified component
|
Color |
setGreen(int green)
Creates a new Color object with specified component
|
Color |
setRed(int red)
Creates a new Color object with specified component
|
java.lang.String |
toString() |
public static final Color WHITE
public static final Color SILVER
public static final Color GRAY
public static final Color BLACK
public static final Color RED
public static final Color MAROON
public static final Color YELLOW
public static final Color OLIVE
public static final Color LIME
public static final Color GREEN
public static final Color AQUA
public static final Color TEAL
public static final Color BLUE
public static final Color NAVY
public static final Color FUCHSIA
public static final Color PURPLE
public static final Color ORANGE
public static Color fromRGB(int red, int green, int blue) throws java.lang.IllegalArgumentException
red
- integer 取值0-255green
- integer 取值 0-255blue
- integer 取值 0-255java.lang.IllegalArgumentException
- if any value is strictly >255 or <0public static Color fromBGR(int blue, int green, int red) throws java.lang.IllegalArgumentException
blue
- integer 取值 0-255green
- integer 取值 0-255red
- integer 取值 0-255java.lang.IllegalArgumentException
- 任何一个参数超出 >255 or <0 范围public static Color fromRGB(int rgb) throws java.lang.IllegalArgumentException
rgb
- the integer storing the red, green, and blue valuesjava.lang.IllegalArgumentException
- if any data is in the highest order 8
bitspublic static Color fromBGR(int bgr) throws java.lang.IllegalArgumentException
bgr
- the integer storing the blue, green, and red valuesjava.lang.IllegalArgumentException
- if any data is in the highest order 8
bitspublic int getRed()
public Color setRed(int red)
red
- the red component, from 0 to 255public int getGreen()
public Color setGreen(int green)
green
- the red component, from 0 to 255public int getBlue()
public Color setBlue(int blue)
blue
- the red component, from 0 to 255public int asRGB()
public int asBGR()
public Color mixDyes(DyeColor... colors)
colors
- The DyeColors to dye withpublic Color mixColors(Color... colors)
colors
- The colors to dye withpublic boolean equals(java.lang.Object o)
equals
在类中 java.lang.Object
public int hashCode()
hashCode
在类中 java.lang.Object
public java.util.Map<java.lang.String,java.lang.Object> serialize()
ConfigurationSerializable
This class must provide a method to restore this class, as defined in
the ConfigurationSerializable
interface javadocs.
serialize
在接口中 ConfigurationSerializable
public static Color deserialize(java.util.Map<java.lang.String,java.lang.Object> map)
public java.lang.String toString()
toString
在类中 java.lang.Object