C# Class Microsoft.Xna.Framework.ColorExtensions

Show file Open project: Thraka/SadConsole

Public Properties

Property Type Description
ColorMappings Color>.Dictionary

Public Methods

Method Description
BlueOnly ( this color ) : Color

Returns a new Color using only the Blue value of this color.

FromParser ( this color, string value, bool &keepR, bool &keepG, bool &keepB, bool &keepA, bool &useDefault ) : Color

Gets a color in the format of SadConsole.ParseCommandRecolor.

GetBrightness ( this color ) : float
GetHue ( this color ) : float
GetLuma ( this color ) : float
GetRandomColor ( this color, Random random ) : Color
GetSaturation ( this color ) : float
GreenOnly ( this color ) : Color

Returns a new Color using only the Green value of this color.

LerpSteps ( this color, Color endingColor, int steps ) : Color[]
RedOnly ( this color ) : Color

Returns a new Color using only the Red value of this color.

SetHSL ( this color, float h, float s, float l ) : void
ToInteger ( this color ) : uint
ToParser ( this color ) : string

Converts a color to the format used by SadConsole.ParseCommandRecolor command.

Private Methods

Method Description
Hue_2_RGB ( float v1, float v2, float vH ) : float

Method Details

BlueOnly() public static method

Returns a new Color using only the Blue value of this color.
public static BlueOnly ( this color ) : Color
color this Object instance.
return Color

FromParser() public static method

Gets a color in the format of SadConsole.ParseCommandRecolor.
public static FromParser ( this color, string value, bool &keepR, bool &keepG, bool &keepB, bool &keepA, bool &useDefault ) : Color
color this
value string
keepR bool
keepG bool
keepB bool
keepA bool
useDefault bool
return Color

GetBrightness() public static method

public static GetBrightness ( this color ) : float
color this
return float

GetHue() public static method

public static GetHue ( this color ) : float
color this
return float

GetLuma() public static method

public static GetLuma ( this color ) : float
color this
return float

GetRandomColor() public static method

public static GetRandomColor ( this color, Random random ) : Color
color this
random System.Random
return Color

GetSaturation() public static method

public static GetSaturation ( this color ) : float
color this
return float

GreenOnly() public static method

Returns a new Color using only the Green value of this color.
public static GreenOnly ( this color ) : Color
color this Object instance.
return Color

LerpSteps() public static method

public static LerpSteps ( this color, Color endingColor, int steps ) : Color[]
color this
endingColor Color
steps int
return Color[]

RedOnly() public static method

Returns a new Color using only the Red value of this color.
public static RedOnly ( this color ) : Color
color this Object instance.
return Color

SetHSL() public static method

public static SetHSL ( this color, float h, float s, float l ) : void
color this
h float
s float
l float
return void

ToInteger() public static method

public static ToInteger ( this color ) : uint
color this
return uint

ToParser() public static method

Converts a color to the format used by SadConsole.ParseCommandRecolor command.
public static ToParser ( this color ) : string
color this The color to convert.
return string

Property Details

ColorMappings public static property

Custom color mappings for the FromParser(Color, string, out bool, out bool, out bool, out bool, out bool) method.
public static Dictionary ColorMappings
return Color>.Dictionary