Class Ansi
Class to store the Ansi codes required for styling, all of the properties return System.String.Empty
if Log73.Log73Options.UseAnsi is false
.
Mostly derived from https://en.wikipedia.org/wiki/ANSI_escape_code.
Assembly: Log73.dll
View Source
Declaration
public static class Ansi
Properties
Normal
Disable all ANSI effects.
View Source
Declaration
public static string Normal { get; }
Bold
View Source
Declaration
public static string Bold { get; }
BoldOff
View Source
Declaration
public static string BoldOff { get; }
NormalColor
View Source
Declaration
public static string NormalColor { get; }
Faint
View Source
Declaration
public static string Faint { get; }
Underline
View Source
Declaration
public static string Underline { get; }
UnderlineOff
View Source
Declaration
public static string UnderlineOff { get; }
Italic
View Source
Declaration
public static string Italic { get; }
NotItalic
View Source
Declaration
public static string NotItalic { get; }
SlowBlink
View Source
Declaration
public static string SlowBlink { get; }
RapidBlink
View Source
Declaration
public static string RapidBlink { get; }
BlinkOff
View Source
Declaration
public static string BlinkOff { get; }
Invert
View Source
Declaration
public static string Invert { get; }
InvertOff
View Source
Declaration
public static string InvertOff { get; }
CrossedOut
View Source
Declaration
public static string CrossedOut { get; }
CrossedOutOff
View Source
Declaration
public static string CrossedOutOff { get; }
DefaultForegroundColor
View Source
Declaration
public static string DefaultForegroundColor { get; }
DefaultBackgroundColor
View Source
Declaration
public static string DefaultBackgroundColor { get; }
Methods
ForegroundColor(String, Color)
Add ANSI foreground color to text.
View Source
Declaration
public static string ForegroundColor(string str, Color color)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | str |
System.Drawing.Color | color |
BackgroundColor(String, Color)
Add ANSI background color to text.
View Source
Declaration
public static string BackgroundColor(string str, Color color)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | str |
System.Drawing.Color | color |
ApplyColor(String, Nullable<Color>, Nullable<Color>)
View Source
Declaration
public static string ApplyColor(string str, Color? foregroundColor, Color? backgroundColor)
Returns
System.String
Parameters
Type | Name |
---|---|
System.String | str |
System.Nullable<System.Drawing.Color> | foregroundColor |
System.Nullable<System.Drawing.Color> | backgroundColor |
BestMatch(Color, IColorScheme)
View Source
Declaration
public static Color BestMatch(Color input, IColorScheme colorScheme)
Returns
System.Drawing.Color
Parameters
Type | Name |
---|---|
System.Drawing.Color | input |
Log73.ColorSchemes.IColorScheme | colorScheme |
ColorToConsoleColor(Color, IColorScheme)
View Source
Declaration
public static ConsoleColor ColorToConsoleColor(Color color, IColorScheme colorScheme)
Returns
System.ConsoleColor
Parameters
Type | Name |
---|---|
System.Drawing.Color | color |
Log73.ColorSchemes.IColorScheme | colorScheme |