程序包 org.bukkit
类 Color
java.lang.Object
org.bukkit.Color
- 所有已实现的接口:
- ConfigurationSerializable
这是一个调色板的容器。该类是不可更改的; 使用set方法可以返回一个新的自定义颜色。
 这里颜色名字的列表为 HTML4 标准色,
 但是随时可能更改
- 
字段概要字段修饰符和类型字段说明static final Color浅绿,或(R,G,B) 表示为 0x00,0xFF,0xFF)static final Color黑色,或(R,G,B) 表示为 0x00,0x00,0x00)static final Color蓝色,或(R,G,B) 表示为 0x00,0x00,0xFF)static final Color樱红色,或(R,G,B) 表示为 0xFF,0x00,0xFF)static final Color灰色,或(R,G,B) 表示为 0x80,0x80,0x80)static final Color绿色,或(R,G,B) 表示为 0x00,0x80,0x00)static final Color黄绿色,或(R,G,B) 表示为 0x00,0xFF,0x00)static final Color栗色,或(R,G,B) 表示为 0x80,0x00,0x00)static final Color海军色,或(R,G,B) 表示为 0x00,0x00,0x80)static final Color橄榄色,或(R,G,B) 表示为 0x80,0x80,0x00)static final Color橙色,或(R,G,B) 表示为 0xFF,0xA5,0x00)static final Color紫色,或(R,G,B) 表示为 0x80,0x00,0x80)static final Color红色,或(R,G,B) 表示为 0xFF,0x00,0x00)static final Color银色,或(R,G,B) 表示为 0xC0,0xC0,0xC0)static final Color蓝绿色,或(R,G,B) 表示为 0x00,0x80,0x80)static final Color白色,或(R,G,B) 表示为 0xFF,0xFF,0xFF)static final Color黄色,或(R,G,B) 表示为 0xFF,0xFF,0x00)
- 
方法概要修饰符和类型方法说明intasARGB()Gets the color as an ARGB integer.intasBGR()Gets the color as an BGR integer.intasRGB()deserialize(@NotNull Map<String, Object> map) booleanfromARGB(int argb) Creates a new color object from an integer that contains the alpha, red, green, and blue bytes.fromARGB(int alpha, int red, int green, int blue) Creates a new Color object from an alpha, red, green, and bluefromBGR(int bgr) Creates a new color object from an integer that contains the blue, green, and red bytes in the lowest order 24 bits.fromBGR(int blue, int green, int red) 用 蓝,绿,红 创建一个新的颜色对象fromRGB(int rgb) 从一个RGB整数中创建一个新的颜色对象,该对象包含最低24bitsfromRGB(int red, int green, int blue) 用 红,绿,蓝 创建一个新的颜色对象intgetAlpha()Gets the alpha componentintgetBlue()Gets the blue componentintgetGreen()Gets the green componentintgetRed()Gets the red componentinthashCode()Creates a new color with its RGB components changed as if it was dyed with the colors passed in, replicating vanilla workbench dyeing.Creates a new color with its RGB components changed as if it was dyed with the colors passed in, replicating vanilla workbench dyeingCreates a Map representation of this class.setAlpha(int alpha) Creates a new Color object with specified componentsetBlue(int blue) Creates a new Color object with specified componentsetGreen(int green) Creates a new Color object with specified componentsetRed(int red) Creates a new Color object with specified componenttoString()
- 
字段详细资料- 
WHITE白色,或(R,G,B) 表示为 0xFF,0xFF,0xFF)
- 
SILVER银色,或(R,G,B) 表示为 0xC0,0xC0,0xC0)
- 
GRAY灰色,或(R,G,B) 表示为 0x80,0x80,0x80)
- 
BLACK黑色,或(R,G,B) 表示为 0x00,0x00,0x00)
- 
RED红色,或(R,G,B) 表示为 0xFF,0x00,0x00)
- 
MAROON栗色,或(R,G,B) 表示为 0x80,0x00,0x00)
- 
YELLOW黄色,或(R,G,B) 表示为 0xFF,0xFF,0x00)
- 
OLIVE橄榄色,或(R,G,B) 表示为 0x80,0x80,0x00)
- 
LIME黄绿色,或(R,G,B) 表示为 0x00,0xFF,0x00)
- 
GREEN绿色,或(R,G,B) 表示为 0x00,0x80,0x00)
- 
AQUA浅绿,或(R,G,B) 表示为 0x00,0xFF,0xFF)
- 
TEAL蓝绿色,或(R,G,B) 表示为 0x00,0x80,0x80)
- 
BLUE蓝色,或(R,G,B) 表示为 0x00,0x00,0xFF)
- 
NAVY海军色,或(R,G,B) 表示为 0x00,0x00,0x80)
- 
FUCHSIA樱红色,或(R,G,B) 表示为 0xFF,0x00,0xFF)
- 
PURPLE紫色,或(R,G,B) 表示为 0x80,0x00,0x80)
- 
ORANGE橙色,或(R,G,B) 表示为 0xFF,0xA5,0x00)
 
- 
- 
方法详细资料- 
fromARGB@NotNull public static @NotNull Color fromARGB(int alpha, int red, int green, int blue) throws IllegalArgumentException Creates a new Color object from an alpha, red, green, and blue- 参数:
- alpha- integer from 0-255
- red- integer from 0-255
- green- integer from 0-255
- blue- integer from 0-255
- 返回:
- a new Color object for the alpha, red, green, blue
- 抛出:
- IllegalArgumentException- if any value is strictly >255 or <0
 
- 
fromRGB@NotNull public static @NotNull Color fromRGB(int red, int green, int blue) throws IllegalArgumentException 用 红,绿,蓝 创建一个新的颜色对象- 参数:
- red- integer 取值0-255
- green- integer 取值 0-255
- blue- integer 取值 0-255
- 返回:
- 一个RGB颜色对象
- 抛出:
- IllegalArgumentException- if any value is strictly >255 or <0
 
- 
fromBGR@NotNull public static @NotNull Color fromBGR(int blue, int green, int red) throws IllegalArgumentException 用 蓝,绿,红 创建一个新的颜色对象- 参数:
- blue- integer 取值 0-255
- green- integer 取值 0-255
- red- integer 取值 0-255
- 返回:
- a new Color object for the red, green, blue
- 抛出:
- IllegalArgumentException- 任何一个参数超出 >255 or <0 范围
 
- 
fromRGB从一个RGB整数中创建一个新的颜色对象,该对象包含最低24bits- 参数:
- rgb- the integer storing the red, green, and blue values
- 返回:
- a new color object for specified values
- 抛出:
- IllegalArgumentException- if any data is in the highest order 8 bits
 
- 
fromARGBCreates a new color object from an integer that contains the alpha, red, green, and blue bytes.- 参数:
- argb- the integer storing the alpha, red, green, and blue values
- 返回:
- a new color object for specified values
 
- 
fromBGRCreates a new color object from an integer that contains the blue, green, and red bytes in the lowest order 24 bits.- 参数:
- bgr- the integer storing the blue, green, and red values
- 返回:
- a new color object for specified values
- 抛出:
- IllegalArgumentException- if any data is in the highest order 8 bits
 
- 
getAlphapublic int getAlpha()Gets the alpha component- 返回:
- alpha component, from 0 to 255
 
- 
setAlphaCreates a new Color object with specified component- 参数:
- alpha- the alpha component, from 0 to 255
- 返回:
- a new color object with the red component
 
- 
getRedpublic int getRed()Gets the red component- 返回:
- red component, from 0 to 255
 
- 
setRedCreates a new Color object with specified component- 参数:
- red- the red component, from 0 to 255
- 返回:
- a new color object with the red component
 
- 
getGreenpublic int getGreen()Gets the green component- 返回:
- green component, from 0 to 255
 
- 
setGreenCreates a new Color object with specified component- 参数:
- green- the red component, from 0 to 255
- 返回:
- a new color object with the red component
 
- 
getBluepublic int getBlue()Gets the blue component- 返回:
- blue component, from 0 to 255
 
- 
setBlueCreates a new Color object with specified component- 参数:
- blue- the red component, from 0 to 255
- 返回:
- a new color object with the red component
 
- 
asRGBpublic int asRGB()- 返回:
- An integer representation of this color, as 0xRRGGBB
 
- 
asARGBpublic int asARGB()Gets the color as an ARGB integer.- 返回:
- An integer representation of this color, as 0xAARRGGBB
 
- 
asBGRpublic int asBGR()Gets the color as an BGR integer.- 返回:
- 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- 参数:
- colors- The DyeColors to dye with
- 返回:
- 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. Note that this method does not currently take into account alpha components.- 参数:
- colors- The colors to dye with
- 返回:
- A new color with the changed rgb components
 
- 
equals
- 
hashCodepublic int hashCode()
- 
serialize从接口复制的说明:ConfigurationSerializableCreates a Map representation of this class.This class must provide a method to restore this class, as defined in the ConfigurationSerializableinterface javadocs.- 指定者:
- serialize在接口中- ConfigurationSerializable
- 返回:
- Map containing the current state of this class
 
- 
deserialize
- 
toString
 
-