Enum Class ChatColor

java.lang.Object
java.lang.Enum<ChatColor>
net.md_5.bungee.api.ChatColor
All Implemented Interfaces:
Serializable, Comparable<ChatColor>, Constable

public enum ChatColor extends Enum<ChatColor>
Simplistic enumeration of all supported color values for chat.
  • Enum Constant Details

    • BLACK

      public static final ChatColor BLACK
      Represents black.
    • DARK_BLUE

      public static final ChatColor DARK_BLUE
      Represents dark blue.
    • DARK_GREEN

      public static final ChatColor DARK_GREEN
      Represents dark green.
    • DARK_AQUA

      public static final ChatColor DARK_AQUA
      Represents dark blue (aqua).
    • DARK_RED

      public static final ChatColor DARK_RED
      Represents dark red.
    • DARK_PURPLE

      public static final ChatColor DARK_PURPLE
      Represents dark purple.
    • GOLD

      public static final ChatColor GOLD
      Represents gold.
    • GRAY

      public static final ChatColor GRAY
      Represents gray.
    • DARK_GRAY

      public static final ChatColor DARK_GRAY
      Represents dark gray.
    • BLUE

      public static final ChatColor BLUE
      Represents blue.
    • GREEN

      public static final ChatColor GREEN
      Represents green.
    • AQUA

      public static final ChatColor AQUA
      Represents aqua.
    • RED

      public static final ChatColor RED
      Represents red.
    • LIGHT_PURPLE

      public static final ChatColor LIGHT_PURPLE
      Represents light purple.
    • YELLOW

      public static final ChatColor YELLOW
      Represents yellow.
    • WHITE

      public static final ChatColor WHITE
      Represents white.
  • Field Details

    • COLOR_CHAR

      public static final char COLOR_CHAR
      The 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

      public static ChatColor[] 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

      public static ChatColor valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Overrides:
      toString in class Enum<ChatColor>
    • stripColor

      public static String stripColor(String input)
      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

      public static String translateAlternateColorCodes(char altColorChar, String textToTranslate)
    • getByChar

      public static ChatColor getByChar(char code)
      Get the colour represented by the specified code.
      Parameters:
      code - the code to search for
      Returns:
      the mapped colour, or null if non exists