Class Colors

java.lang.Object
ch.autumo.commons.console.Colors

public final class Colors extends Object
ANSI Colors. To activate ANSI colors in Windows: - CMD and PowerShell: "reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1" - PowerShell: "Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1" - You also could download the Windows Terminal: Windows Terminal See also: https://stackoverflow.com/questions/51680709/colored-text-output-in-powershell-console-using-ansi-vt100-codes/51681675#51681675
  • Method Details

    • foregroundColorize

      public static String foregroundColorize(String text, com.diogonunes.jcolor.Attribute attribute)
      Colorize text.
      Parameters:
      text - text to colorize
      attribute - color attribute
      Returns:
      ANSI colored text
    • black

      public static String black(String text)
      Black colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkBlack

      public static String darkBlack(String text)
      Dark-Black colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • white

      public static String white(String text)
      White colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkWhite

      public static String darkWhite(String text)
      Dark-White colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • mangenta

      public static String mangenta(String text)
      Mangenta colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkMangenta

      public static String darkMangenta(String text)
      Dark-Mangenta colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • cyan

      public static String cyan(String text)
      Cyan colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkCyan

      public static String darkCyan(String text)
      Dark-Cyan colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • green

      public static String green(String text)
      Green colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkGreen

      public static String darkGreen(String text)
      Dark-Green colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • yellow

      public static String yellow(String text)
      Yellow colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkYellow

      public static String darkYellow(String text)
      Dark-Yellow colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • red

      public static String red(String text)
      Red colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • darkRed

      public static String darkRed(String text)
      Dark-Red colored string.
      Parameters:
      text - text
      Returns:
      colored string
    • orange

      public static String orange(String text)
      Orange colored string. Unsupported by most terminals.
      Parameters:
      text - text
      Returns:
      colored string