Enum Class TextColor
- All Implemented Interfaces:
Serializable
,Comparable<TextColor>
,java.lang.constant.Constable
Color Code Converter Enum
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Method Summary
Modifier and TypeMethodDescriptionGet this color as an Ansi Color CodeGet this color as a Minecraft Color Codestatic String
convertColor
(char character, String str) Convert Minecraft color codes starting with character to Ansi color codesstatic String
convertColor
(String str) Convert Minecraft color codes to Ansi color codesstatic String
parseColor
(char character, String str) Parse Minecraft color codes starting with characterstatic String
stripColor
(String str) Removes all Minecraft/Ansi color codes from a stringtoString()
static TextColor
Returns the enum constant of this class with the specified name.static TextColor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AQUA
-
BLACK
-
BLUE
-
BOLD
-
DARK_AQUA
-
DARK_BLUE
-
DARK_GRAY
-
DARK_GREEN
-
DARK_PURPLE
-
DARK_RED
-
GOLD
-
GRAY
-
GREEN
-
ITALIC
-
LIGHT_PURPLE
-
MAGIC
-
RED
-
RESET
-
STRIKETHROUGH
-
UNDERLINE
-
WHITE
-
YELLOW
-
-
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
-
asMinecraftCode
Get this color as a Minecraft Color Code- Returns:
- Minecraft Color Code
-
asAnsiCode
Get this color as an Ansi Color Code- Returns:
- Ansi Color Code
-
toString
-
parseColor
Parse Minecraft color codes starting with character- Parameters:
character
- Characterstr
- String to parse- Returns:
- Minecraft colored string
-
convertColor
Convert Minecraft color codes to Ansi color codes- Parameters:
str
- Minecraft colored string- Returns:
- Ansi colored string
-
convertColor
Convert Minecraft color codes starting with character to Ansi color codes- Parameters:
character
- Characterstr
- String to parse- Returns:
- Ansi colored string
-
stripColor
Removes all Minecraft/Ansi color codes from a string- Parameters:
str
- String to parse- Returns:
- String without color
-