C# Class WebApplications.Utilities.Formatting.ColorHelper

显示文件 Open project: webappsuk/CoreLibraries

Private Properties

Property Type Description
GetName string

Public Methods

Method Description
GetColor ( [ name ) : Optional

Gets the color corresponding to the name; otherwise returns Optional{Color}.Unassigned.

RemoveName ( [ name ) : Optional

Removes the custom color name.

SetName ( this color, [ name ) : void

Sets a custom name for the color.

ToColor ( this color ) : Color

Gets the Color of a ConsoleColor.

ToConsoleColor ( this color ) : ConsoleColor

Converts a Color to the nearest ConsoleColor.

Private Methods

Method Description
GetName ( this color ) : string

Method Details

GetColor() public static method

Gets the color corresponding to the name; otherwise returns Optional{Color}.Unassigned.
public static GetColor ( [ name ) : Optional
name [ The name.
return Optional

RemoveName() public static method

Removes the custom color name.
public static RemoveName ( [ name ) : Optional
name [ The name.
return Optional

SetName() public static method

Sets a custom name for the color.
public static SetName ( this color, [ name ) : void
color this The color.
name [ The name.
return void

ToColor() public static method

Gets the Color of a ConsoleColor.
public static ToColor ( this color ) : Color
color this The color.
return Color

ToConsoleColor() public static method

Converts a Color to the nearest ConsoleColor.
public static ToConsoleColor ( this color ) : ConsoleColor
color this The color.
return ConsoleColor