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
- Object
- 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
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 BLACKBlack.
RED
public static final Ansi.Color REDRed.
GREEN
public static final Ansi.Color GREENGreen.
YELLOW
public static final Ansi.Color YELLOWYellow.
BLUE
public static final Ansi.Color BLUEBlue.
MAGENTA
public static final Ansi.Color MAGENTAMagenta.
CYAN
public static final Ansi.Color CYANCyan.
WHITE
public static final Ansi.Color WHITEWhite.
GRAY
public static final Ansi.Color GRAYBright black, which terminals show as gray.
BRIGHT_RED
public static final Ansi.Color BRIGHT_REDBright red.
BRIGHT_GREEN
public static final Ansi.Color BRIGHT_GREENBright green.
BRIGHT_YELLOW
public static final Ansi.Color BRIGHT_YELLOWBright yellow.
BRIGHT_BLUE
public static final Ansi.Color BRIGHT_BLUEBright blue.
BRIGHT_MAGENTA
public static final Ansi.Color BRIGHT_MAGENTABright magenta.
BRIGHT_CYAN
public static final Ansi.Color BRIGHT_CYANBright cyan.
BRIGHT_WHITE
public static final Ansi.Color BRIGHT_WHITEBright white.
DEFAULT
public static final Ansi.Color DEFAULTThe 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
hexis not six hex digits.
indexed
public static Ansi.Color indexed(int index)Entry
index (0-255) of the 256-color palette.