Package net.md_5.bungee.api
Enum Class ChatColor
- All Implemented Interfaces:
Serializable,Comparable<ChatColor>,Constable
Simplistic enumeration of all supported color values for chat.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRepresents aqua.Represents black.Represents blue.Represents dark blue (aqua).Represents dark blue.Represents dark gray.Represents dark green.Represents dark purple.Represents dark red.Represents gold.Represents gray.Represents green.Represents light purple.Represents red.Represents white.Represents yellow. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charThe special character which prefixes all chat colour codes. -
Method Summary
Modifier and TypeMethodDescriptionstatic ChatColorgetByChar(char code) Get the colour represented by the specified code.static StringstripColor(String input) Strips the given message of all color codestoString()static StringtranslateAlternateColorCodes(char altColorChar, String textToTranslate) static ChatColorReturns the enum constant of this class with the specified name.static ChatColor[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BLACK
Represents black. -
DARK_BLUE
Represents dark blue. -
DARK_GREEN
Represents dark green. -
DARK_AQUA
Represents dark blue (aqua). -
DARK_RED
Represents dark red. -
DARK_PURPLE
Represents dark purple. -
GOLD
Represents gold. -
GRAY
Represents gray. -
DARK_GRAY
Represents dark gray. -
BLUE
Represents blue. -
GREEN
Represents green. -
AQUA
Represents aqua. -
RED
Represents red. -
LIGHT_PURPLE
Represents light purple. -
YELLOW
Represents yellow. -
WHITE
Represents white.
-
-
Field Details
-
COLOR_CHAR
public static final char COLOR_CHARThe special character which prefixes all chat colour codes. Use this if you need to dynamically convert colour codes from your custom format.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
toString
-
stripColor
Strips the given message of all color codes- Parameters:
input- String to strip of color- Returns:
- A copy of the input string, without any coloring
-
translateAlternateColorCodes
-
getByChar
Get the colour represented by the specified code.- Parameters:
code- the code to search for- Returns:
- the mapped colour, or null if non exists
-