Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public static final class Ansi.Color

  1. Object
  2. Ansi.Color
A foreground or background color: one of the 16 basic colors, an index into the 256-color palette, or a 24-bit RGB value.

Fields

public static final Ansi.Color BLACKBlack.
public static final Ansi.Color REDRed.
public static final Ansi.Color GREENGreen.
public static final Ansi.Color YELLOWYellow.
public static final Ansi.Color BLUEBlue.
public static final Ansi.Color MAGENTAMagenta.
public static final Ansi.Color CYANCyan.
public static final Ansi.Color WHITEWhite.
public static final Ansi.Color GRAYBright black, which terminals show as gray.
public static final Ansi.Color BRIGHT_REDBright red.
public static final Ansi.Color BRIGHT_GREENBright green.
public static final Ansi.Color BRIGHT_YELLOWBright yellow.
public static final Ansi.Color BRIGHT_BLUEBright blue.
public static final Ansi.Color BRIGHT_MAGENTABright magenta.
public static final Ansi.Color BRIGHT_CYANBright cyan.
public static final Ansi.Color BRIGHT_WHITEBright white.
public static final Ansi.Color DEFAULTThe terminal’s own default color.

Methods

public static Ansi.Color rgb(int r, int g, int b)A 24-bit color; each component is clamped to 0-255.
public static Ansi.Color hex(String hex)A color written #rrggbb or rrggbb.
public static Ansi.Color indexed(int index)Entry index (0-255) of the 256-color palette.

Inherited methods

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.