Skip to content

Helpers Class

Helpers related to ANSI processing.

C#
public static class Helpers

Inheritance object

Returns the a normal, dark, ansi color based on the ansi color provided.

C#
public static Color AnsiJustNormalColor(Color input)

input SadRogue.Primitives.Color
An ansi color.

SadRogue.Primitives.Color
The adjusted color.

If the color provided is not an ansi color, dark or light, the passed in color will be returned.

Adjusts the provided color based on the bold value.

C#
public static Color AnsiAdjustColor(Color input, bool bold)

input SadRogue.Primitives.Color
The ansi color to adjust.

bold bool
When true, adjusts the color to the bright version. When false, adjusts the color to the normal version.

SadRogue.Primitives.Color
The adjusted color.

If the color provided is not an ansi color, dark or light, the passed in color will be returned.

Sets the print appearance of the cursor based on the ANSI.SYS code provided.

C#
public static void AnsiConfigurePrintColor(bool isBackground, int code, State ansiState)

isBackground bool
When true, changes the background color instead of the foreground.

code int
The 0-7 color code.

ansiState State
The current state of the ANSI settings.