Module com.github.rvesse.airline.io
Enum Class BasicColor
- All Implemented Interfaces:
AnsiColorProvider
,Serializable
,Comparable<BasicColor>
,Constable
The 8 basic ANSI Colours
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
BasicColor
(int index, String name) private
BasicColor
(int index, String name, boolean highIntensity) -
Method Summary
Modifier and TypeMethodDescriptionGets the ANSI control code for setting the background colourprivate String
getAnsiControlCode
(int base) Gets the ANSI control code for setting the foreground colourtoString()
boolean
Gets whether extended colours are used as this will affect the ANSI reset sequence that needs to be usedstatic BasicColor
Returns the enum constant of this class with the specified name.static BasicColor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
BLACK
-
RED
-
GREEN
-
YELLOW
-
BLUE
-
MAGENTA
-
CYAN
-
WHITE
-
BRIGHT_BLACK
-
BRIGHT_RED
-
BRIGHT_GREEN
-
BRIGHT_YELLOW
-
BRIGHT_BLUE
-
BRIGHT_MAGENTA
-
BRIGHT_CYAN
-
BRIGHT_WHITE
-
-
Field Details
-
index
private final int index -
name
-
highIntensity
private final boolean highIntensity
-
-
Constructor Details
-
BasicColor
-
BasicColor
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getAnsiForegroundControlCode
Description copied from interface:AnsiColorProvider
Gets the ANSI control code for setting the foreground colour- Specified by:
getAnsiForegroundControlCode
in interfaceAnsiColorProvider
- Returns:
- Foreground control code
-
getAnsiBackgroundControlCode
Description copied from interface:AnsiColorProvider
Gets the ANSI control code for setting the background colour- Specified by:
getAnsiBackgroundControlCode
in interfaceAnsiColorProvider
- Returns:
- Background control code
-
usesExtendedColors
public boolean usesExtendedColors()Description copied from interface:AnsiColorProvider
Gets whether extended colours are used as this will affect the ANSI reset sequence that needs to be used- Specified by:
usesExtendedColors
in interfaceAnsiColorProvider
- Returns:
- True if extended colours are used, false otherwise
-
getAnsiControlCode
-
toString
- Overrides:
toString
in classEnum<BasicColor>
-