java.lang.Object
net.orbyfied.j8.util.logging.formatting.AnsiAttr
net.orbyfied.j8.util.logging.formatting.attr.ColorAttr
Direct Known Subclasses:
TextFormat

public abstract class ColorAttr extends AnsiAttr
  • Field Details

    • color

      protected String[] color
      Color string/array. 3 elements if RGB, 1 if 8-bit.
    • col

      protected Object col
      The raw color object. This is a 'char' if it is 8-bit and a java.awt.Color object if RGB.
  • Constructor Details

    • ColorAttr

      public ColorAttr(char c)
      8-bit constructor.
      Parameters:
      c - The color number/character (range 0-255)
    • ColorAttr

      public ColorAttr(int r, int g, int b)
      24-bit RGB constructor.
      Parameters:
      r - Red.
      g - Green.
      b - Blue.
    • ColorAttr

      public ColorAttr(Color color)
      Parameters:
      color - The color object.
      See Also:
  • Method Details

    • getColorAsObject

      public Object getColorAsObject()
    • isRGB

      public boolean isRGB()
      Checks if the attribute contains an RGB color.
      Returns:
      The boolean.
    • seqPrefix

      public abstract String seqPrefix(Object... args)
      Generates a sequence prefix.
    • sequence

      public String sequence()
    • code

      public String code(Object... args)
      Description copied from class: AnsiAttr
      Returns/generates the ANSI escape code of the attribute.
      Specified by:
      code in class AnsiAttr
      Returns:
      The escape code.