API Reference
Class
SgrEncoder
Encodes styles as SGR (Select Graphic Rendition) sequences for a colour depth. Every style change emits a full reset plus the new attributes, which is robust on every VT implementation (conhost, Windows Terminal, xterm.js) and keeps frames independent of any previous terminal state.
Inheritance
- Object
- SgrEncoder
Methods
public static Void Append(StringBuilder builder, Style style, ColorDepth depth) #Returns:
VoidAppends the SGR sequence for a style (including the reset prefix).
Parameters
- builder System.Text.StringBuilder
- The target.
- style ConsoleMonster.Styling.Style
- The style.
- depth ConsoleMonster.Capabilities.ColorDepth
- The colour depth; colours are downsampled to it.
public static String Encode(Style style, ColorDepth depth) #Returns:
StringReturns the SGR sequence for a style.
Parameters
- style ConsoleMonster.Styling.Style
- The style.
- depth ConsoleMonster.Capabilities.ColorDepth
- The colour depth.
Returns
The sequence, or an empty string for ColorDepth.None.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?