Enum stl_AnsiColors

java.lang.Object
java.lang.Enum<stl_AnsiColors>
com.jackmeng.stl.stl_AnsiColors
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<stl_AnsiColors>, java.lang.constant.Constable

public enum stl_AnsiColors
extends java.lang.Enum<stl_AnsiColors>
A constant enum for defining all common Ansi Colors and the ability to make custom ones. This class is used in conjunction with stl_AnsiMake to create Ansi colored Strings.
Author:
Jack Meng
See Also:
stl_AnsiMake
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    java.lang.Enum.EnumDesc<E extends java.lang.Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant Description
    BLACK_BG  
    BLACK_TXT  
    BLINK  
    BLUE_BG  
    BLUE_TXT  
    BOLD  
    CYAN_BG  
    CYAN_TXT  
    GREEN_BG  
    GREEN_TXT  
    HIDDEN  
    MAGENTA_BG  
    MAGENTA_TXT  
    RED_BG  
    RED_TXT  
    RESET  
    REVERSE  
    UNDERLINE  
    WHITE_BG  
    WHITE_TXT  
    YELLOW_BG  
    YELLOW_TXT  
  • Field Summary

    Fields
    Modifier and Type Field Description
    private java.lang.String color  
  • Constructor Summary

    Constructors
    Modifier Constructor Description
    private stl_AnsiColors​(java.lang.String color)  
  • Method Summary

    Modifier and Type Method Description
    java.lang.String brighter()
    Makes the current Ansi color brighter by modifying the string.
    java.lang.String color()  
    static java.lang.String construct​(int id)
    Make your own Ansi color string provided a color id.
    static stl_AnsiColors valueOf​(java.lang.String name)
    Returns the enum constant of this type with the specified name.
    static stl_AnsiColors[] values()
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Enum

    clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

  • Field Details

    • color

      private final java.lang.String color
  • Constructor Details

    • stl_AnsiColors

      private stl_AnsiColors​(java.lang.String color)
  • Method Details

    • values

      public static stl_AnsiColors[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static stl_AnsiColors valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
      java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
      java.lang.NullPointerException - if the argument is null
    • color

      public java.lang.String color()
      Returns:
      The internal String value of the color
    • brighter

      public java.lang.String brighter()
      Makes the current Ansi color brighter by modifying the string.
      Returns:
      The modified color in a String. The color is automatically appended.
    • construct

      public static java.lang.String construct​(int id)
      Make your own Ansi color string provided a color id.
      Parameters:
      id - The color id in the range of [0,255]
      Returns:
      If the provided color is valid in the range [0,255], the custom color will be returned else a WHITE_TXT will be returned.