public enum Ansi4BitBackgroundColor extends Enum<Ansi4BitBackgroundColor> implements AnsiElement
来自Spring Boot
| Enum Constant and Description |
|---|
BLACK
黑色
|
BLUE
蓝
|
BRIGHT_BLACK
亮黑
|
BRIGHT_BLUE
亮蓝
|
BRIGHT_CYAN
亮青
|
BRIGHT_GREEN
亮绿
|
BRIGHT_MAGENTA
亮品红
|
BRIGHT_RED
亮红
|
BRIGHT_WHITE
亮白
|
BRIGHT_YELLOW
亮黄
|
CYAN
青
|
DEFAULT
默认背景色
|
GREEN
绿
|
MAGENTA
品红
|
RED
红
|
WHITE
白
|
YELLOW
黄
|
| Modifier and Type | Method and Description |
|---|---|
Ansi4BitColor |
asForeground()
获取背景色对应的前景色
|
int |
getCode()
获取ANSI颜色代码
|
int |
getCode(boolean isBackground)
获取ANSI颜色代码
|
static Ansi4BitBackgroundColor |
of(int code)
根据code查找对应的Ansi4BitBackgroundColor
|
String |
toString() |
static Ansi4BitBackgroundColor |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Ansi4BitBackgroundColor[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Ansi4BitBackgroundColor DEFAULT
public static final Ansi4BitBackgroundColor BLACK
public static final Ansi4BitBackgroundColor RED
public static final Ansi4BitBackgroundColor GREEN
public static final Ansi4BitBackgroundColor YELLOW
public static final Ansi4BitBackgroundColor BLUE
public static final Ansi4BitBackgroundColor MAGENTA
public static final Ansi4BitBackgroundColor CYAN
public static final Ansi4BitBackgroundColor WHITE
public static final Ansi4BitBackgroundColor BRIGHT_BLACK
public static final Ansi4BitBackgroundColor BRIGHT_RED
public static final Ansi4BitBackgroundColor BRIGHT_GREEN
public static final Ansi4BitBackgroundColor BRIGHT_YELLOW
public static final Ansi4BitBackgroundColor BRIGHT_BLUE
public static final Ansi4BitBackgroundColor BRIGHT_MAGENTA
public static final Ansi4BitBackgroundColor BRIGHT_CYAN
public static final Ansi4BitBackgroundColor BRIGHT_WHITE
public static Ansi4BitBackgroundColor[] values()
for (Ansi4BitBackgroundColor c : Ansi4BitBackgroundColor.values()) System.out.println(c);
public static Ansi4BitBackgroundColor valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic int getCode()
getCode in interface AnsiElementpublic int getCode(boolean isBackground)
isBackground - 是否背景色public Ansi4BitColor asForeground()
public String toString()
toString in interface AnsiElementtoString in class Enum<Ansi4BitBackgroundColor>public static Ansi4BitBackgroundColor of(int code)
code - Ansi 4bit 颜色代码Copyright © 2025. All rights reserved.