- java.lang.Object
-
- org.jline.terminal.impl.ColorSupport
-
public class ColorSupport extends java.lang.ObjectParses OSC 10/11 color query responses from the terminal.Terminals that support OSC color queries respond with an escape sequence containing the current foreground (OSC 10) or background (OSC 11) color as an
rgb:RRRR/GGGG/BBBBvalue. This class reads and decodes those responses into a packed 24-bit RGB integer.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intparseColorResponse(NonBlockingReader reader, int colorType)Reads an OSC color response from the terminal and returns the color as a 24-bit RGB integer.
-
-
-
Method Detail
-
parseColorResponse
public static int parseColorResponse(NonBlockingReader reader, int colorType) throws java.io.IOException
Reads an OSC color response from the terminal and returns the color as a 24-bit RGB integer.- Parameters:
reader- non-blocking reader connected to the terminal inputcolorType- the OSC color type to match (10 for foreground, 11 for background)- Returns:
- the color as a packed 24-bit RGB integer (
0xRRGGBB), or-1if no valid response was received - Throws:
java.io.IOException- if an I/O error occurs while reading from the terminal
-
-