Package com.diogonunes.jcolor
Class Attribute
java.lang.Object
com.diogonunes.jcolor.Attribute
Abstracts ANSI codes with intuitive names. It maps a description (e.g. RED_TEXT) with a code (e.g. 31).
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Attribute
BACK_COLOR
(int colorNumber) static Attribute
BACK_COLOR
(int r, int g, int b) static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
BOLD()
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
CLEAR()
static Attribute
static Attribute
static Attribute
static Attribute
DIM()
static Attribute
static Attribute
FRAMED()
static Attribute
static Attribute
static Attribute
HIDDEN()
static Attribute
ITALIC()
static Attribute
static Attribute
static Attribute
NONE()
static Attribute
static Attribute
static Attribute
RED_BACK()
static Attribute
RED_TEXT()
static Attribute
REVERSE()
static Attribute
static Attribute
static Attribute
static Attribute
TEXT_COLOR
(int colorNumber) static Attribute
TEXT_COLOR
(int r, int g, int b) abstract String
toString()
static Attribute
static Attribute
static Attribute
static Attribute
static Attribute
-
Constructor Details
-
Attribute
public Attribute()
-
-
Method Details
-
toString
-
NONE
-
CLEAR
- Returns:
- Clears any format. Restores the terminal's default format.
-
BOLD
-
SATURATED
- Returns:
- Alias of BOLD().
-
DIM
-
DESATURATED
- Returns:
- Alias of DIM().
-
ITALIC
-
UNDERLINE
-
SLOW_BLINK
-
RAPID_BLINK
-
REVERSE
-
HIDDEN
-
STRIKETHROUGH
-
FRAMED
-
ENCIRCLED
-
OVERLINED
-
BLACK_TEXT
-
RED_TEXT
-
GREEN_TEXT
-
YELLOW_TEXT
-
BLUE_TEXT
-
MAGENTA_TEXT
-
CYAN_TEXT
-
WHITE_TEXT
-
BLACK_BACK
-
RED_BACK
-
GREEN_BACK
-
YELLOW_BACK
-
BLUE_BACK
-
MAGENTA_BACK
-
CYAN_BACK
-
WHITE_BACK
-
BRIGHT_BLACK_TEXT
-
BRIGHT_RED_TEXT
-
BRIGHT_GREEN_TEXT
-
BRIGHT_YELLOW_TEXT
-
BRIGHT_BLUE_TEXT
-
BRIGHT_MAGENTA_TEXT
-
BRIGHT_CYAN_TEXT
-
BRIGHT_WHITE_TEXT
-
BRIGHT_BLACK_BACK
-
BRIGHT_RED_BACK
-
BRIGHT_GREEN_BACK
-
BRIGHT_YELLOW_BACK
-
BRIGHT_BLUE_BACK
-
BRIGHT_MAGENTA_BACK
-
BRIGHT_CYAN_BACK
-
BRIGHT_WHITE_BACK
-
TEXT_COLOR
- Parameters:
colorNumber
- A number (0-255) that represents an 8-bit color.- Returns:
- An Attribute that represents a foreground with an 8-bit color.
-
TEXT_COLOR
- Parameters:
r
- A number (0-255) that represents the red component.g
- A number (0-255) that represents the green component.b
- A number (0-255) that represents the blue component.- Returns:
- An Attribute that represents a foreground with a true color.
-
BACK_COLOR
- Parameters:
colorNumber
- A number (0-255) that represents an 8-bit color.- Returns:
- An Attribute that represents a background with an 8-bit color.
-
BACK_COLOR
- Parameters:
r
- A number (0-255) that represents the red component.g
- A number (0-255) that represents the green component.b
- A number (0-255) that represents the blue component.- Returns:
- An Attribute that represents a background with a true color.
-