- java.lang.Object
-
- java.lang.Enum<AttributedCharSequence.ForceMode>
-
- org.jline.utils.AttributedCharSequence.ForceMode
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<AttributedCharSequence.ForceMode>
- Enclosing class:
- AttributedCharSequence
public static enum AttributedCharSequence.ForceMode extends java.lang.Enum<AttributedCharSequence.ForceMode>
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 as38;2;r;g;bwhen the terminal supportsAttributedCharSequence.HIGH_COLORS, regardless of this setting.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description Force256ColorsForce indexed colors to use 256-color encoding (38;5;n) even when a basic SGR code would suffice.ForceTrueColorsForce 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.NoneNo 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
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AttributedCharSequence.ForceModevalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static AttributedCharSequence.ForceMode[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
None
public static final AttributedCharSequence.ForceMode 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
public static final AttributedCharSequence.ForceMode Force256Colors
Force indexed colors to use 256-color encoding (38;5;n) even when a basic SGR code would suffice.
-
ForceTrueColors
public static final AttributedCharSequence.ForceMode 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 Detail
-
values
public static AttributedCharSequence.ForceMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (AttributedCharSequence.ForceMode c : AttributedCharSequence.ForceMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AttributedCharSequence.ForceMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-