Class Attribute

java.lang.Object
com.diogonunes.jcolor.Attribute

public abstract class Attribute extends Object
Abstracts ANSI codes with intuitive names. It maps a description (e.g. RED_TEXT) with a code (e.g. 31).
See Also:
  • Constructor Details

    • Attribute

      public Attribute()
  • Method Details

    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
      Returns:
      The Attribute's ansi escape code.
    • NONE

      public static Attribute NONE()
    • CLEAR

      public static Attribute CLEAR()
      Returns:
      Clears any format. Restores the terminal's default format.
    • BOLD

      public static Attribute BOLD()
    • SATURATED

      public static Attribute SATURATED()
      Returns:
      Alias of BOLD().
    • DIM

      public static Attribute DIM()
    • DESATURATED

      public static Attribute DESATURATED()
      Returns:
      Alias of DIM().
    • ITALIC

      public static Attribute ITALIC()
    • UNDERLINE

      public static Attribute UNDERLINE()
    • SLOW_BLINK

      public static Attribute SLOW_BLINK()
    • RAPID_BLINK

      public static Attribute RAPID_BLINK()
    • REVERSE

      public static Attribute REVERSE()
    • HIDDEN

      public static Attribute HIDDEN()
    • STRIKETHROUGH

      public static Attribute STRIKETHROUGH()
    • FRAMED

      public static Attribute FRAMED()
    • ENCIRCLED

      public static Attribute ENCIRCLED()
    • OVERLINED

      public static Attribute OVERLINED()
    • BLACK_TEXT

      public static Attribute BLACK_TEXT()
    • RED_TEXT

      public static Attribute RED_TEXT()
    • GREEN_TEXT

      public static Attribute GREEN_TEXT()
    • YELLOW_TEXT

      public static Attribute YELLOW_TEXT()
    • BLUE_TEXT

      public static Attribute BLUE_TEXT()
    • MAGENTA_TEXT

      public static Attribute MAGENTA_TEXT()
    • CYAN_TEXT

      public static Attribute CYAN_TEXT()
    • WHITE_TEXT

      public static Attribute WHITE_TEXT()
    • BLACK_BACK

      public static Attribute BLACK_BACK()
    • RED_BACK

      public static Attribute RED_BACK()
    • GREEN_BACK

      public static Attribute GREEN_BACK()
    • YELLOW_BACK

      public static Attribute YELLOW_BACK()
    • BLUE_BACK

      public static Attribute BLUE_BACK()
    • MAGENTA_BACK

      public static Attribute MAGENTA_BACK()
    • CYAN_BACK

      public static Attribute CYAN_BACK()
    • WHITE_BACK

      public static Attribute WHITE_BACK()
    • BRIGHT_BLACK_TEXT

      public static Attribute BRIGHT_BLACK_TEXT()
    • BRIGHT_RED_TEXT

      public static Attribute BRIGHT_RED_TEXT()
    • BRIGHT_GREEN_TEXT

      public static Attribute BRIGHT_GREEN_TEXT()
    • BRIGHT_YELLOW_TEXT

      public static Attribute BRIGHT_YELLOW_TEXT()
    • BRIGHT_BLUE_TEXT

      public static Attribute BRIGHT_BLUE_TEXT()
    • BRIGHT_MAGENTA_TEXT

      public static Attribute BRIGHT_MAGENTA_TEXT()
    • BRIGHT_CYAN_TEXT

      public static Attribute BRIGHT_CYAN_TEXT()
    • BRIGHT_WHITE_TEXT

      public static Attribute BRIGHT_WHITE_TEXT()
    • BRIGHT_BLACK_BACK

      public static Attribute BRIGHT_BLACK_BACK()
    • BRIGHT_RED_BACK

      public static Attribute BRIGHT_RED_BACK()
    • BRIGHT_GREEN_BACK

      public static Attribute BRIGHT_GREEN_BACK()
    • BRIGHT_YELLOW_BACK

      public static Attribute BRIGHT_YELLOW_BACK()
    • BRIGHT_BLUE_BACK

      public static Attribute BRIGHT_BLUE_BACK()
    • BRIGHT_MAGENTA_BACK

      public static Attribute BRIGHT_MAGENTA_BACK()
    • BRIGHT_CYAN_BACK

      public static Attribute BRIGHT_CYAN_BACK()
    • BRIGHT_WHITE_BACK

      public static Attribute BRIGHT_WHITE_BACK()
    • TEXT_COLOR

      public static Attribute TEXT_COLOR(int colorNumber)
      Parameters:
      colorNumber - A number (0-255) that represents an 8-bit color.
      Returns:
      An Attribute that represents a foreground with an 8-bit color.
    • TEXT_COLOR

      public static Attribute TEXT_COLOR(int r, int g, int b)
      Parameters:
      r - A number (0-255) that represents the red component.
      g - A number (0-255) that represents the green component.
      b - A number (0-255) that represents the blue component.
      Returns:
      An Attribute that represents a foreground with a true color.
    • BACK_COLOR

      public static Attribute BACK_COLOR(int colorNumber)
      Parameters:
      colorNumber - A number (0-255) that represents an 8-bit color.
      Returns:
      An Attribute that represents a background with an 8-bit color.
    • BACK_COLOR

      public static Attribute BACK_COLOR(int r, int g, int b)
      Parameters:
      r - A number (0-255) that represents the red component.
      g - A number (0-255) that represents the green component.
      b - A number (0-255) that represents the blue component.
      Returns:
      An Attribute that represents a background with a true color.