Enum Class TextColor

java.lang.Object
java.lang.Enum<TextColor>
net.ME1312.SubServers.Host.Library.TextColor
All Implemented Interfaces:
Serializable, Comparable<TextColor>, java.lang.constant.Constable

public enum TextColor extends Enum<TextColor>
Color Code Converter Enum
  • Enum Constant Details

    • AQUA

      public static final TextColor AQUA
    • BLACK

      public static final TextColor BLACK
    • BLUE

      public static final TextColor BLUE
    • BOLD

      public static final TextColor BOLD
    • DARK_AQUA

      public static final TextColor DARK_AQUA
    • DARK_BLUE

      public static final TextColor DARK_BLUE
    • DARK_GRAY

      public static final TextColor DARK_GRAY
    • DARK_GREEN

      public static final TextColor DARK_GREEN
    • DARK_PURPLE

      public static final TextColor DARK_PURPLE
    • DARK_RED

      public static final TextColor DARK_RED
    • GOLD

      public static final TextColor GOLD
    • GRAY

      public static final TextColor GRAY
    • GREEN

      public static final TextColor GREEN
    • ITALIC

      public static final TextColor ITALIC
    • LIGHT_PURPLE

      public static final TextColor LIGHT_PURPLE
    • MAGIC

      public static final TextColor MAGIC
    • RED

      public static final TextColor RED
    • RESET

      public static final TextColor RESET
    • STRIKETHROUGH

      public static final TextColor STRIKETHROUGH
    • UNDERLINE

      public static final TextColor UNDERLINE
    • WHITE

      public static final TextColor WHITE
    • YELLOW

      public static final TextColor YELLOW
  • Method Details

    • values

      public static TextColor[] 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 TextColor 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
    • asMinecraftCode

      public String asMinecraftCode()
      Get this color as a Minecraft Color Code
      Returns:
      Minecraft Color Code
    • asAnsiCode

      public String asAnsiCode()
      Get this color as an Ansi Color Code
      Returns:
      Ansi Color Code
    • toString

      public String toString()
      Overrides:
      toString in class Enum<TextColor>
    • parseColor

      public static String parseColor(char character, String str)
      Parse Minecraft color codes starting with character
      Parameters:
      character - Character
      str - String to parse
      Returns:
      Minecraft colored string
    • convertColor

      public static String convertColor(String str)
      Convert Minecraft color codes to Ansi color codes
      Parameters:
      str - Minecraft colored string
      Returns:
      Ansi colored string
    • convertColor

      public static String convertColor(char character, String str)
      Convert Minecraft color codes starting with character to Ansi color codes
      Parameters:
      character - Character
      str - String to parse
      Returns:
      Ansi colored string
    • stripColor

      public static String stripColor(String str)
      Removes all Minecraft/Ansi color codes from a string
      Parameters:
      str - String to parse
      Returns:
      String without color