Enum Class AttributedCharSequence.ForceMode

java.lang.Object
java.lang.Enum<AttributedCharSequence.ForceMode>
org.jline.utils.AttributedCharSequence.ForceMode
All Implemented Interfaces:
Serializable, Comparable<AttributedCharSequence.ForceMode>, Constable
Enclosing class:
AttributedCharSequence

public static enum AttributedCharSequence.ForceMode extends 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 as 38;2;r;g;b when the terminal supports AttributedCharSequence.HIGH_COLORS, regardless of this setting.

  • Enum Constant Details

    • 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-color 38;5;n, or true-color 38;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 supports AttributedCharSequence.HIGH_COLORS. This does not override the color count check for direct RGB values.
  • Method Details

    • values

      public static AttributedCharSequence.ForceMode[] 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

      public static AttributedCharSequence.ForceMode valueOf(String name)
      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 name
      NullPointerException - if the argument is null