Enum Class BasicColor

java.lang.Object
java.lang.Enum<BasicColor>
com.github.rvesse.airline.io.colors.BasicColor
All Implemented Interfaces:
AnsiColorProvider, Serializable, Comparable<BasicColor>, Constable

public enum BasicColor extends Enum<BasicColor> implements AnsiColorProvider
The 8 basic ANSI Colours
  • Enum Constant Details

    • BLACK

      public static final BasicColor BLACK
    • RED

      public static final BasicColor RED
    • GREEN

      public static final BasicColor GREEN
    • YELLOW

      public static final BasicColor YELLOW
    • BLUE

      public static final BasicColor BLUE
    • MAGENTA

      public static final BasicColor MAGENTA
    • CYAN

      public static final BasicColor CYAN
    • WHITE

      public static final BasicColor WHITE
    • BRIGHT_BLACK

      public static final BasicColor BRIGHT_BLACK
    • BRIGHT_RED

      public static final BasicColor BRIGHT_RED
    • BRIGHT_GREEN

      public static final BasicColor BRIGHT_GREEN
    • BRIGHT_YELLOW

      public static final BasicColor BRIGHT_YELLOW
    • BRIGHT_BLUE

      public static final BasicColor BRIGHT_BLUE
    • BRIGHT_MAGENTA

      public static final BasicColor BRIGHT_MAGENTA
    • BRIGHT_CYAN

      public static final BasicColor BRIGHT_CYAN
    • BRIGHT_WHITE

      public static final BasicColor BRIGHT_WHITE
  • Field Details

    • index

      private final int index
    • name

      private final String name
    • highIntensity

      private final boolean highIntensity
  • Constructor Details

    • BasicColor

      private BasicColor(int index, String name)
    • BasicColor

      private BasicColor(int index, String name, boolean highIntensity)
  • Method Details

    • values

      public static BasicColor[] 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 BasicColor 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
    • getAnsiForegroundControlCode

      public String getAnsiForegroundControlCode()
      Description copied from interface: AnsiColorProvider
      Gets the ANSI control code for setting the foreground colour
      Specified by:
      getAnsiForegroundControlCode in interface AnsiColorProvider
      Returns:
      Foreground control code
    • getAnsiBackgroundControlCode

      public String getAnsiBackgroundControlCode()
      Description copied from interface: AnsiColorProvider
      Gets the ANSI control code for setting the background colour
      Specified by:
      getAnsiBackgroundControlCode in interface AnsiColorProvider
      Returns:
      Background control code
    • usesExtendedColors

      public boolean usesExtendedColors()
      Description copied from interface: AnsiColorProvider
      Gets whether extended colours are used as this will affect the ANSI reset sequence that needs to be used
      Specified by:
      usesExtendedColors in interface AnsiColorProvider
      Returns:
      True if extended colours are used, false otherwise
    • getAnsiControlCode

      private String getAnsiControlCode(int base)
    • toString

      public String toString()
      Overrides:
      toString in class Enum<BasicColor>