C# Class Colorful.ColorManager

Manages the number of different colors that the Windows console is able to display in a given session.
Show file Open project: tomakita/Colorful.Console Class Usage Examples

Public Methods

Method Description
ColorManager ( ColorStore colorStore, ColorMapper colorMapper, int maxColorChanges, int initialColorChangeCountValue ) : System

Manages the number of different colors that the Windows console is able to display in a given session.

GetColor ( ConsoleColor color ) : Color

Gets the System.Drawing.Color mapped to the ConsoleColor provided as an argument.

GetConsoleColor ( Color color ) : ConsoleColor

Gets the ConsoleColor mapped to the System.Drawing.Color provided as an argument.

Private Methods

Method Description
CanChangeColor ( ) : bool
GetConsoleColorNative ( Color color ) : ConsoleColor

Method Details

ColorManager() public method

Manages the number of different colors that the Windows console is able to display in a given session.
public ColorManager ( ColorStore colorStore, ColorMapper colorMapper, int maxColorChanges, int initialColorChangeCountValue ) : System
colorStore ColorStore The ColorStore instance in which the ColorManager will store colors.
colorMapper ColorMapper The ColorMapper instance the ColorManager will use to relate different color /// types to one another.
maxColorChanges int The maximum number of color changes allowed by the ColorManager. It's /// necessary to keep track of this, because the Windows console can only display 16 different colors in /// a given session.
initialColorChangeCountValue int The number of color changes which have already occurred.
return System

GetColor() public method

Gets the System.Drawing.Color mapped to the ConsoleColor provided as an argument.
public GetColor ( ConsoleColor color ) : Color
color ConsoleColor The ConsoleColor alias under which the desired System.Drawing.Color is stored.
return Color

GetConsoleColor() public method

Gets the ConsoleColor mapped to the System.Drawing.Color provided as an argument.
public GetConsoleColor ( Color color ) : ConsoleColor
color Color The System.Drawing.Color whose ConsoleColor alias should be retrieved.
return ConsoleColor