Package org.jline.utils
Enum Class AttributedCharSequence.ForceMode
- All Implemented Interfaces:
Serializable,Comparable<AttributedCharSequence.ForceMode>,Constable
- Enclosing class:
AttributedCharSequence
Controls how indexed (palette) colors are rendered in ANSI output.
These modes only affect colors that have been resolved to a palette index.
Direct RGB colors (set via AttributedStyle.foreground(int, int, int))
are always emitted as 38;2;r;g;b when the terminal supports
AttributedCharSequence.HIGH_COLORS, regardless of this setting.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionForce indexed colors to use 256-color encoding (38;5;n) even when a basic SGR code would suffice.Force indexed colors to be expanded to true-color RGB (38;2;r;g;b) via the palette, but only when the terminal supportsAttributedCharSequence.HIGH_COLORS.No forcing; indexed colors are rendered using the best encoding for the terminal's reported color count (basic SGR 30-37/90-97, 256-color38;5;n, or true-color38;2;r;g;b). -
Method Summary
Modifier and TypeMethodDescriptionReturns the enum constant of this class with the specified name.static AttributedCharSequence.ForceMode[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
None
No forcing; indexed colors are rendered using the best encoding for the terminal's reported color count (basic SGR 30-37/90-97, 256-color38;5;n, or true-color38;2;r;g;b). -
Force256Colors
Force indexed colors to use 256-color encoding (38;5;n) even when a basic SGR code would suffice. -
ForceTrueColors
Force indexed colors to be expanded to true-color RGB (38;2;r;g;b) via the palette, but only when the terminal supportsAttributedCharSequence.HIGH_COLORS. This does not override the color count check for direct RGB values.
-
-
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
-