Table of Contents

Method TryParseOscColorResponse

Namespace
Terminal.Gui.Drivers
Assembly
Terminal.Gui.dll

TryParseOscColorResponse(string?, out Color?)

Attempts to parse an OSC 10/11 color response into a Color.

public static bool TryParseOscColorResponse(string? response, out Color? color)

Parameters

response string

The raw response string, e.g. ESC]10;rgb:RRRR/GGGG/BBBB ESC</code> or ESC]11;rgb:RR/GG/BB BEL.

color Color?

The parsed color, or null if parsing fails.

Returns

bool

true if the response was successfully parsed.

Remarks

Handles both 4-digit (16-bit) and 2-digit (8-bit) per-channel hex values. For 16-bit values, the high byte is used (e.g. RRRRRR).