API Reference
Class
TerminalBackground
Detects terminal background appearance using output-side and environment information only.
Inheritance
- Object
- TerminalBackground
Methods
public static Double CalculateLuminance(Byte red, Byte green, Byte blue) #Returns:
DoubleCalculates WCAG relative luminance from 8-bit sRGB channels.
Parameters
- red System.Byte
- green System.Byte
- blue System.Byte
public static Int32 GetAttributeIndex(UInt16 attributes) #Returns:
Int32Extracts the background palette index from console attributes.
Parameters
- attributes System.UInt16
public static Boolean TryDetect(out TerminalBackgroundInfo info) #Returns:
BooleanAttempts to detect the terminal background without reading standard input.
Parameters
- info ConsoleMonster.Output.TerminalBackgroundInfo
- The detected background or an unknown result.
Returns
True when a background classification was available.
public static Boolean TryParseColorFgbg(String? value, out Boolean isLight) #Returns:
BooleanParses a COLORFGBG foreground/background value.
Parameters
- value System.String?
- A semicolon-separated foreground and background index.
- isLight System.Boolean
- Whether the valid background index denotes a light colour.
Returns
True when the background index was valid.
Inherited Methods
public virtual Boolean Equals(Object? obj) #Returns:
BooleanInherited from Object
Parameters
- obj Object?