C# Class Pastel.ConsoleExtensions

Controls colored console output by .
Exibir arquivo Open project: Invenietis/CK-Monitoring

Public Methods

Method Description
Disable ( ) : void

Disables any future console color output produced by Pastel.

Enable ( ) : void

Enables any future console color output produced by Pastel.

FromColor ( ConsoleColor c ) : Color

Convert a ConsoleColor to a Color.

Pastel ( string input, Color color ) : string

Returns a string wrapped in an ANSI foreground color code using the specified color.

Pastel ( string input, ConsoleColor color ) : string

Returns a string wrapped in an ANSI foreground color code using the specified color.

Pastel ( string input, string hexColor ) : string

Returns a string wrapped in an ANSI foreground color code using the specified color.

PastelBg ( string input, Color color ) : string

Returns a string wrapped in an ANSI background color code using the specified color.

PastelBg ( string input, ConsoleColor color ) : string

Returns a string wrapped in an ANSI background color code using the specified color.

PastelBg ( string input, string hexColor ) : string

Returns a string wrapped in an ANSI background color code using the specified color.

Private Methods

Method Description
CloseNestedPastelStrings ( string input, Color color, ColorPlane colorPlane ) : string
ConsoleExtensions ( ) : System
GetConsoleMode ( IntPtr hConsoleHandle, uint &lpMode ) : bool
GetStdHandle ( int nStdHandle ) : IntPtr
SetConsoleMode ( IntPtr hConsoleHandle, uint dwMode ) : bool

Method Details

Disable() public static method

Disables any future console color output produced by Pastel.
public static Disable ( ) : void
return void

Enable() public static method

Enables any future console color output produced by Pastel.
public static Enable ( ) : void
return void

FromColor() public static method

Convert a ConsoleColor to a Color.
public static FromColor ( ConsoleColor c ) : Color
c ConsoleColor
return Color

Pastel() public static method

Returns a string wrapped in an ANSI foreground color code using the specified color.
public static Pastel ( string input, Color color ) : string
input string The string to color.
color Color The color to use on the specified string.
return string

Pastel() public static method

Returns a string wrapped in an ANSI foreground color code using the specified color.
public static Pastel ( string input, ConsoleColor color ) : string
input string The string to color.
color ConsoleColor The color to use on the specified string.
return string

Pastel() public static method

Returns a string wrapped in an ANSI foreground color code using the specified color.
public static Pastel ( string input, string hexColor ) : string
input string The string to color.
hexColor string The color to use on the specified string.Supported format: [#]RRGGBB.
return string

PastelBg() public static method

Returns a string wrapped in an ANSI background color code using the specified color.
public static PastelBg ( string input, Color color ) : string
input string The string to color.
color Color The color to use on the specified string.
return string

PastelBg() public static method

Returns a string wrapped in an ANSI background color code using the specified color.
public static PastelBg ( string input, ConsoleColor color ) : string
input string The string to color.
color ConsoleColor The color to use on the specified string.
return string

PastelBg() public static method

Returns a string wrapped in an ANSI background color code using the specified color.
public static PastelBg ( string input, string hexColor ) : string
input string The string to color.
hexColor string The color to use on the specified string.Supported format: [#]RRGGBB.
return string