Enum Constant and Description |
---|
BLACK
Represents black
|
BLUE
Represents blue
|
BLUE_DARK
Represents dark blue
|
BOLD
Makes the text bold.
|
CYAN
Represents aqua
|
CYAN_DARK
Represents dark blue (aqua)
|
GRAY
Represents gray
|
GRAY_DARK
Represents dark gray
|
GREEN
Represents green
|
GREEN_DARK
Represents dark green
|
ITALIC
Makes the text italic.
|
PURPLE
Represents light purple
|
PURPLE_DARK
Represents dark purple
|
RANDOMIZE
Represents magical characters that change around randomly
|
RED
Represents red
|
RED_DARK
Represents dark red
|
RESET
Resets all previous chat colors or formats.
|
STRIKETHROUGH
Makes a line appear through the text.
|
UNDERLINE
Makes the text appear underlined.
|
WHITE
Represents white
|
YELLOW
Represents yellow
|
YELLOW_DARK
Represents gold
|
Modifier and Type | Field and Description |
---|---|
static char |
COLOR_CHAR
The special character which prefixes all chat color codes.
|
Modifier and Type | Method and Description |
---|---|
static Style |
getByChar(char code)
Gets the color represented by the specified color code
|
static Style |
getByChar(java.lang.String code)
Gets the color represented by the specified color code
|
char |
getChar()
Gets the char value associated with this color
|
static java.lang.String |
getLastColors(java.lang.String input)
Gets the ChatColors used at the end of the given input string.
|
boolean |
isColor()
Checks if this code is a color code as opposed to a format code.
|
boolean |
isFormat()
Checks if this code is a format code as opposed to a color code.
|
static java.lang.String |
stripColor(java.lang.String input)
Strips the given message of all color codes
|
java.lang.String |
toString() |
static java.lang.String |
translateAlternateColorCodes(char altColorChar,
java.lang.String textToTranslate)
Translates a string using an alternate color code character into a string that uses the internal
ChatColor.COLOR_CODE color code character.
|
static Style |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Style[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Style BLACK
public static final Style BLUE_DARK
public static final Style GREEN_DARK
public static final Style CYAN_DARK
public static final Style RED_DARK
public static final Style PURPLE_DARK
public static final Style YELLOW_DARK
public static final Style GRAY
public static final Style GRAY_DARK
public static final Style BLUE
public static final Style GREEN
public static final Style CYAN
public static final Style RED
public static final Style PURPLE
public static final Style YELLOW
public static final Style WHITE
public static final Style RANDOMIZE
public static final Style BOLD
public static final Style STRIKETHROUGH
public static final Style UNDERLINE
public static final Style ITALIC
public static final Style RESET
public static final char COLOR_CHAR
public static Style[] values()
for (Style c : Style.values()) System.out.println(c);
public static Style valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic char getChar()
public java.lang.String toString()
toString
in class java.lang.Enum<Style>
public boolean isFormat()
public boolean isColor()
public static Style getByChar(char code)
code
- Code to checkpublic static Style getByChar(java.lang.String code)
code
- Code to checkpublic static java.lang.String stripColor(java.lang.String input)
input
- String to strip of colorpublic static java.lang.String translateAlternateColorCodes(char altColorChar, java.lang.String textToTranslate)
altColorChar
- The alternate color code character to replace. Ex: &textToTranslate
- Text containing the alternate color code character.public static java.lang.String getLastColors(java.lang.String input)
input
- Input string to retrieve the colors from.