Color Utility
RGB int
Returns bit shifted RGB int.
RGBA int
Returns bit shifted RGB int with alpha.
Get Color
Returns java.awt.Color.
Returns java.awt.Color with alpha.
Tip
If updated a lot, you should always use this since the color is cached in order to prevent excessive allocations.
RGB from EnumChatFormatting
Converts EnumChatFormatting, returns RGB int.
Color from EnumChatFormatting
Converts EnumChatFormatting, returns java.awt.Color.
EnumChatFormatting from String
Returns EnumChatFormatting from string. The string should not contain any spaces or special symbols & must contain a valid color.
black
dark_blue
dark_green
dark_aqua
dark_red
dark_purple
gold
gray
dark_gray
blue
green
aqua
red
light_purple
yellow
white
EnumChatFormatting from code
Returns EnumChatFormatting from a Minecraft color code. Must be a valid code.
Unformatted text
Returns the string without any formatting codes.
Convert formatting
Returns the string with converted Minecraft formatting codes, converts &<code> to §<code>. Will not convert & without a valid code.
Example
Converts to gold text:
&6Meow → §6Meow
Converts while preserving:
&6Meow & &cMeow → §6Meow & §cMeow
Convert opacity
Converts opacity 0-100% to 0-255 alpha.