Class Ansi8BitColor

java.lang.Object
org.springframework.boot.ansi.Ansi8BitColor
All Implemented Interfaces:
AnsiElement

public final class Ansi8BitColor extends Object implements AnsiElement
AnsiElement implementation for ANSI 8-bit foreground or background color codes.
Since:
2.2.0
Author:
Toshiaki Maki, Phillip Webb
See Also:
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Specified by:
      toString in interface AnsiElement
      Overrides:
      toString in class Object
      Returns:
      the ANSI escape code
    • foreground

      public static Ansi8BitColor foreground(int code)
      Return a foreground ANSI color code instance for the given code.
      Parameters:
      code - the color code
      Returns:
      an ANSI color code instance
    • background

      public static Ansi8BitColor background(int code)
      Return a background ANSI color code instance for the given code.
      Parameters:
      code - the color code
      Returns:
      an ANSI color code instance