Class Ansi.Color

java.lang.Object
com.codename1.cli.Ansi.Color
Enclosing class:
Ansi

public static final class Ansi.Color extends Object
A foreground or background color: one of the 16 basic colors, an index into the 256-color palette, or a 24-bit RGB value.
  • Field Details

    • BLACK

      public static final Ansi.Color BLACK
      Black.
    • RED

      public static final Ansi.Color RED
      Red.
    • GREEN

      public static final Ansi.Color GREEN
      Green.
    • YELLOW

      public static final Ansi.Color YELLOW
      Yellow.
    • BLUE

      public static final Ansi.Color BLUE
      Blue.
    • MAGENTA

      public static final Ansi.Color MAGENTA
      Magenta.
    • CYAN

      public static final Ansi.Color CYAN
      Cyan.
    • WHITE

      public static final Ansi.Color WHITE
      White.
    • GRAY

      public static final Ansi.Color GRAY
      Bright black, which terminals show as gray.
    • BRIGHT_RED

      public static final Ansi.Color BRIGHT_RED
      Bright red.
    • BRIGHT_GREEN

      public static final Ansi.Color BRIGHT_GREEN
      Bright green.
    • BRIGHT_YELLOW

      public static final Ansi.Color BRIGHT_YELLOW
      Bright yellow.
    • BRIGHT_BLUE

      public static final Ansi.Color BRIGHT_BLUE
      Bright blue.
    • BRIGHT_MAGENTA

      public static final Ansi.Color BRIGHT_MAGENTA
      Bright magenta.
    • BRIGHT_CYAN

      public static final Ansi.Color BRIGHT_CYAN
      Bright cyan.
    • BRIGHT_WHITE

      public static final Ansi.Color BRIGHT_WHITE
      Bright white.
    • DEFAULT

      public static final Ansi.Color DEFAULT
      The terminal's own default color.
  • Method Details

    • rgb

      public static Ansi.Color rgb(int r, int g, int b)
      A 24-bit color; each component is clamped to 0-255.
    • hex

      public static Ansi.Color hex(String hex)

      A color written #rrggbb or rrggbb.

      Throws
      • IllegalArgumentException: when hex is not six hex digits.
    • indexed

      public static Ansi.Color indexed(int index)
      Entry index (0-255) of the 256-color palette.