Serializable
, Comparable<ChatColor>
public enum ChatColor extends Enum<ChatColor>
Enum Constant | Description |
---|---|
AQUA |
Represents aqua
|
BLACK |
Represents black
|
BLUE |
Represents blue
|
BOLD |
Makes the text bold.
|
DARK_AQUA |
Represents dark blue (aqua)
|
DARK_BLUE |
Represents dark blue
|
DARK_GRAY |
Represents dark gray
|
DARK_GREEN |
Represents dark green
|
DARK_PURPLE |
Represents dark purple
|
DARK_RED |
Represents dark red
|
GOLD |
Represents gold
|
GRAY |
Represents gray
|
GREEN |
Represents green
|
ITALIC |
Makes the text italic.
|
LIGHT_PURPLE |
Represents light purple
|
MAGIC |
Represents magical characters that change around randomly
|
RED |
Represents 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
|
Modifier and Type | Field | Description |
---|---|---|
static char |
COLOR_CHAR |
The special character which prefixes all chat colour codes.
|
Modifier and Type | Method | Description |
---|---|---|
net.md_5.bungee.api.ChatColor |
asBungee() |
|
static @Nullable ChatColor |
getByChar(char code) |
Gets the color represented by the specified color code
|
static @Nullable ChatColor |
getByChar(@NotNull String code) |
Gets the color represented by the specified color code
|
char |
getChar() |
Gets the char value associated with this color
|
static @NotNull String |
getLastColors(@NotNull 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 @Nullable String |
stripColor(@Nullable String input) |
Strips the given message of all color codes
|
@NotNull String |
toString() |
|
static @NotNull String |
translateAlternateColorCodes(char altColorChar,
@NotNull 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 ChatColor |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static ChatColor[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ChatColor BLACK
public static final ChatColor DARK_BLUE
public static final ChatColor DARK_GREEN
public static final ChatColor DARK_AQUA
public static final ChatColor DARK_RED
public static final ChatColor DARK_PURPLE
public static final ChatColor GOLD
public static final ChatColor GRAY
public static final ChatColor DARK_GRAY
public static final ChatColor BLUE
public static final ChatColor GREEN
public static final ChatColor AQUA
public static final ChatColor RED
public static final ChatColor LIGHT_PURPLE
public static final ChatColor YELLOW
public static final ChatColor WHITE
public static final ChatColor MAGIC
public static final ChatColor BOLD
public static final ChatColor STRIKETHROUGH
public static final ChatColor UNDERLINE
public static final ChatColor ITALIC
public static final ChatColor RESET
public static final char COLOR_CHAR
public static ChatColor[] values()
for (ChatColor c : ChatColor.values()) System.out.println(c);
public static ChatColor valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@NotNull public net.md_5.bungee.api.ChatColor asBungee()
public char getChar()
public boolean isFormat()
public boolean isColor()
@Nullable public static @Nullable ChatColor getByChar(char code)
code
- Code to checkChatColor
with the given code,
or null if it doesn't exist@Nullable public static @Nullable ChatColor getByChar(@NotNull @NotNull String code)
code
- Code to checkChatColor
with the given code,
or null if it doesn't exist@Contract("!null -> !null; null -> null") @Nullable public static @Nullable String stripColor(@Nullable @Nullable String input)
input
- String to strip of color@NotNull public static @NotNull String translateAlternateColorCodes(char altColorChar, @NotNull @NotNull String textToTranslate)
altColorChar
- The alternate color code character to replace. Ex: &textToTranslate
- Text containing the alternate color code character.Copyright © 2020. All rights reserved.