Package net.md_5.bungee.api

# Class ChatColor

java.lang.Object
net.md_5.bungee.api.ChatColor

public final class ChatColor extends Object
Simplistic enumeration of all supported color values for chat.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `ALL_CODES`
  `static final ChatColor`
  `AQUA`
  Represents aqua.
  `static final ChatColor`
  `BLACK`
  Represents black.
  `static final ChatColor`
  `BLUE`
  Represents blue.
  `static final ChatColor`
  `BOLD`
  Makes the text bold.
  `static final char`
  `COLOR_CHAR`
  The special character which prefixes all chat colour codes.
  `static final ChatColor`
  `DARK_AQUA`
  Represents dark blue (aqua).
  `static final ChatColor`
  `DARK_BLUE`
  Represents dark blue.
  `static final ChatColor`
  `DARK_GRAY`
  Represents dark gray.
  `static final ChatColor`
  `DARK_GREEN`
  Represents dark green.
  `static final ChatColor`
  `DARK_PURPLE`
  Represents dark purple.
  `static final ChatColor`
  `DARK_RED`
  Represents dark red.
  `static final ChatColor`
  `GOLD`
  Represents gold.
  `static final ChatColor`
  `GRAY`
  Represents gray.
  `static final ChatColor`
  `GREEN`
  Represents green.
  `static final ChatColor`
  `ITALIC`
  Makes the text italic.
  `static final ChatColor`
  `LIGHT_PURPLE`
  Represents light purple.
  `static final ChatColor`
  `MAGIC`
  Represents magical characters that change around randomly.
  `static final ChatColor`
  `RED`
  Represents red.
  `static final ChatColor`
  `RESET`
  Resets all previous chat colors or formats.
  `static final ChatColor`
  `STRIKETHROUGH`
  Makes a line appear through the text.
  `static final Pattern`
  `STRIP_COLOR_PATTERN`
  Pattern to remove all colour codes.
  `static final ChatColor`
  `UNDERLINE`
  Makes the text appear underlined.
  `static final ChatColor`
  `WHITE`
  Represents white.
  `static final ChatColor`
  `YELLOW`
  Represents yellow.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object obj)`
  `static ChatColor`
  `getByChar(char code)`
  Get the colour represented by the specified code.
  `Color`
  `getColor()`
  The RGB color of the ChatColor.
  `String`
  `getName()`
  `int`
  `hashCode()`
  `String`
  `name()`
  Deprecated.
  holdover from when this class was an enum
  `static ChatColor`
  `of(Color color)`
  `static ChatColor`
  `of(String string)`
  `int`
  `ordinal()`
  Deprecated.
  holdover from when this class was an enum
  `static String`
  `stripColor(String input)`
  Strips the given message of all color codes
  `String`
  `toString()`
  `static String`
  `translateAlternateColorCodes(char altColorChar, String textToTranslate)`
  `static ChatColor`
  `valueOf(String name)`
  Deprecated.
  holdover from when this class was an enum
  `static ChatColor[]`
  `values()`
  Deprecated.
  holdover from when this class was an enum

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## 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:
      - Constant Field Values

  - ### ALL_CODES

    public static final String ALL_CODES
    See Also:
      - Constant Field Values

  - ### STRIP_COLOR_PATTERN

    public static final Pattern STRIP_COLOR_PATTERN
    Pattern to remove all colour codes.

  - ### 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.

  - ### MAGIC

    public static final ChatColor MAGIC
    Represents magical characters that change around randomly.

  - ### BOLD

    public static final ChatColor BOLD
    Makes the text bold.

  - ### STRIKETHROUGH

    public static final ChatColor STRIKETHROUGH
    Makes a line appear through the text.

  - ### UNDERLINE

    public static final ChatColor UNDERLINE
    Makes the text appear underlined.

  - ### ITALIC

    public static final ChatColor ITALIC
    Makes the text italic.

  - ### RESET

    public static final ChatColor RESET
    Resets all previous chat colors or formats.

- ## Method Details

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### 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

  - ### of

    public static ChatColor of(Color color)

  - ### of

    public static ChatColor of(String string)

  - ### valueOf

    @Deprecated public static ChatColor valueOf(String name)
    Deprecated.
    holdover from when this class was an enum
    See `Enum.valueOf(java.lang.Class, java.lang.String)`.
    Parameters:
      `name` - color name
    Returns:
      ChatColor

  - ### values

    @Deprecated public static ChatColor[] values()
    Deprecated.
    holdover from when this class was an enum
    Get an array of all defined colors and formats.
    Returns:
      copied array of all colors and formats

  - ### name

    @Deprecated public String name()
    Deprecated.
    holdover from when this class was an enum
    See `Enum.name()`.
    Returns:
      constant name

  - ### ordinal

    @Deprecated public int ordinal()
    Deprecated.
    holdover from when this class was an enum
    See `Enum.ordinal()`.
    Returns:
      ordinal

  - ### getName

    public String getName()

  - ### getColor

    public Color getColor()
    The RGB color of the ChatColor. null for non-colors (formatting)