Class Helpers
Helpers related to ANSI processing.
Inherited Members
Namespace: SadConsole.Ansi
Assembly: SadConsole.dll
Syntax
public static class Helpers
Methods
AnsiAdjustColor(Color, bool)
Adjusts the provided color based on the bold
value.
Declaration
public static Color AnsiAdjustColor(Color input, bool bold)
Parameters
Type | Name | Description |
---|---|---|
Color | input | The ansi color to adjust. |
bool | bold | When true, adjusts the color to the bright version. When false, adjusts the color to the normal version. |
Returns
Type | Description |
---|---|
Color | The adjusted color. |
Remarks
If the color provided is not an ansi color, dark or light, the passed in color will be returned.
AnsiConfigurePrintColor(bool, int, State)
Sets the print appearance of the cursor based on the ANSI.SYS code provided.
Declaration
public static void AnsiConfigurePrintColor(bool isBackground, int code, State ansiState)
Parameters
Type | Name | Description |
---|---|---|
bool | isBackground | When true, changes the background color instead of the foreground. |
int | code | The 0-7 color code. |
State | ansiState | The current state of the ANSI settings. |
AnsiJustNormalColor(Color)
Returns the a normal, dark, ansi color based on the ansi color provided.
Declaration
public static Color AnsiJustNormalColor(Color input)
Parameters
Type | Name | Description |
---|---|---|
Color | input | An ansi color. |
Returns
Type | Description |
---|---|
Color | The adjusted color. |
Remarks
If the color provided is not an ansi color, dark or light, the passed in color will be returned.