Class Color
Describes a 32-bit packed color.
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
public sealed class Color : ValueType, IEquatable<Color>, IMatchable<Color>
Constructors
Color(Color, Int32)
Constructs an RGBA color from a Color and an alpha value.
Declaration
public Color(Color color, int alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | |
| Int32 | alpha | The alpha component value from 0 to 255. |
Color(Color, Single)
Constructs an RGBA color from color and alpha value.
Declaration
public Color(Color color, float alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | color | |
| Single | alpha | Alpha component value from 0.0f to 1.0f. |
Color(Byte, Byte, Byte, Byte)
Constructs an RGBA color from scalars representing red, green, blue and alpha values.
Declaration
public Color(byte r, byte g, byte b, byte alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | r | |
| Byte | g | |
| Byte | b | |
| Byte | alpha |
Remarks
This overload sets the values directly without clamping, and may therefore be faster than the other overloads.
Color(Int32, Int32, Int32)
Constructs an RGBA color from scalars representing red, green and blue values. Alpha value will be opaque.
Declaration
public Color(int r, int g, int b)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | r | Red component value from 0 to 255. |
| Int32 | g | Green component value from 0 to 255. |
| Int32 | b | Blue component value from 0 to 255. |
Color(Int32, Int32, Int32, Int32)
Constructs an RGBA color from scalars representing red, green, blue and alpha values.
Declaration
public Color(int r, int g, int b, int alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | r | Red component value from 0 to 255. |
| Int32 | g | Green component value from 0 to 255. |
| Int32 | b | Blue component value from 0 to 255. |
| Int32 | alpha | Alpha component value from 0 to 255. |
Color(Single, Single, Single)
Constructs an RGBA color from scalars representing red, green and blue values. Alpha value will be opaque.
Declaration
public Color(float r, float g, float b)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | r | Red component value from 0.0f to 1.0f. |
| Single | g | Green component value from 0.0f to 1.0f. |
| Single | b | Blue component value from 0.0f to 1.0f. |
Color(Single, Single, Single, Single)
Constructs an RGBA color from scalars representing red, green, blue and alpha values.
Declaration
public Color(float r, float g, float b, float alpha)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | r | Red component value from 0.0f to 1.0f. |
| Single | g | Green component value from 0.0f to 1.0f. |
| Single | b | Blue component value from 0.0f to 1.0f. |
| Single | alpha | Alpha component value from 0.0f to 1.0f. |
Color(UInt32)
Constructs an RGBA color from a packed value. The value is a 32-bit unsigned integer, with R in the least significant octet.
Declaration
public Color(uint packedValue)
Parameters
| Type | Name | Description |
|---|---|---|
| UInt32 | packedValue | The packed value. |
Fields
AliceBlue
AliceBlue color (R:240,G:248,B:255,A:255).
Declaration
public static readonly Color AliceBlue
Field Value
| Type | Description |
|---|---|
| Color |
AnsiBlack
The black ansi color (0, 0, 0).
Declaration
public static readonly Color AnsiBlack
Field Value
| Type | Description |
|---|---|
| Color |
AnsiBlackBright
The BlackBright ansi color (85, 85, 85).
Declaration
public static readonly Color AnsiBlackBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiBlue
The Blue ansi color (0, 0, 170).
Declaration
public static readonly Color AnsiBlue
Field Value
| Type | Description |
|---|---|
| Color |
AnsiBlueBright
The BlueBright ansi color (85, 85, 255).
Declaration
public static readonly Color AnsiBlueBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiCyan
The Cyan ansi color (0, 170, 170).
Declaration
public static readonly Color AnsiCyan
Field Value
| Type | Description |
|---|---|
| Color |
AnsiCyanBright
The CyanBright ansi color (85, 255, 255).
Declaration
public static readonly Color AnsiCyanBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiGreen
The Green ansi color 0, 170, 0).
Declaration
public static readonly Color AnsiGreen
Field Value
| Type | Description |
|---|---|
| Color |
AnsiGreenBright
The GreenBright ansi color (85, 255, 85).
Declaration
public static readonly Color AnsiGreenBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiMagenta
The Magenta ansi color (170, 0, 170).
Declaration
public static readonly Color AnsiMagenta
Field Value
| Type | Description |
|---|---|
| Color |
AnsiMagentaBright
The MagentaBright ansi color (255, 85, 255).
Declaration
public static readonly Color AnsiMagentaBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiRed
The Red ansi color (170, 0, 0).
Declaration
public static readonly Color AnsiRed
Field Value
| Type | Description |
|---|---|
| Color |
AnsiRedBright
The RedBright ansi color (255, 85, 85).
Declaration
public static readonly Color AnsiRedBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiWhite
The White ansi color (170, 170, 170).
Declaration
public static readonly Color AnsiWhite
Field Value
| Type | Description |
|---|---|
| Color |
AnsiWhiteBright
The WhiteBright ansi color (255, 255, 255).
Declaration
public static readonly Color AnsiWhiteBright
Field Value
| Type | Description |
|---|---|
| Color |
AnsiYellow
The Yellow ansi color (170, 85, 0).
Declaration
public static readonly Color AnsiYellow
Field Value
| Type | Description |
|---|---|
| Color |
AnsiYellowBright
The YellowBright ansi color (255, 255, 85).
Declaration
public static readonly Color AnsiYellowBright
Field Value
| Type | Description |
|---|---|
| Color |
AntiqueWhite
AntiqueWhite color (R:250,G:235,B:215,A:255).
Declaration
public static readonly Color AntiqueWhite
Field Value
| Type | Description |
|---|---|
| Color |
Aqua
Aqua color (R:0,G:255,B:255,A:255).
Declaration
public static readonly Color Aqua
Field Value
| Type | Description |
|---|---|
| Color |
Aquamarine
Aquamarine color (R:127,G:255,B:212,A:255).
Declaration
public static readonly Color Aquamarine
Field Value
| Type | Description |
|---|---|
| Color |
Azure
Azure color (R:240,G:255,B:255,A:255).
Declaration
public static readonly Color Azure
Field Value
| Type | Description |
|---|---|
| Color |
Beige
Beige color (R:245,G:245,B:220,A:255).
Declaration
public static readonly Color Beige
Field Value
| Type | Description |
|---|---|
| Color |
Bisque
Bisque color (R:255,G:228,B:196,A:255).
Declaration
public static readonly Color Bisque
Field Value
| Type | Description |
|---|---|
| Color |
Black
Black color (R:0,G:0,B:0,A:255).
Declaration
public static readonly Color Black
Field Value
| Type | Description |
|---|---|
| Color |
BlanchedAlmond
BlanchedAlmond color (R:255,G:235,B:205,A:255).
Declaration
public static readonly Color BlanchedAlmond
Field Value
| Type | Description |
|---|---|
| Color |
Blue
Blue color (R:0,G:0,B:255,A:255).
Declaration
public static readonly Color Blue
Field Value
| Type | Description |
|---|---|
| Color |
BlueViolet
BlueViolet color (R:138,G:43,B:226,A:255).
Declaration
public static readonly Color BlueViolet
Field Value
| Type | Description |
|---|---|
| Color |
Brown
Brown color (R:165,G:42,B:42,A:255).
Declaration
public static readonly Color Brown
Field Value
| Type | Description |
|---|---|
| Color |
BurlyWood
BurlyWood color (R:222,G:184,B:135,A:255).
Declaration
public static readonly Color BurlyWood
Field Value
| Type | Description |
|---|---|
| Color |
CadetBlue
CadetBlue color (R:95,G:158,B:160,A:255).
Declaration
public static readonly Color CadetBlue
Field Value
| Type | Description |
|---|---|
| Color |
Chartreuse
Chartreuse color (R:127,G:255,B:0,A:255).
Declaration
public static readonly Color Chartreuse
Field Value
| Type | Description |
|---|---|
| Color |
Chocolate
Chocolate color (R:210,G:105,B:30,A:255).
Declaration
public static readonly Color Chocolate
Field Value
| Type | Description |
|---|---|
| Color |
Coral
Coral color (R:255,G:127,B:80,A:255).
Declaration
public static readonly Color Coral
Field Value
| Type | Description |
|---|---|
| Color |
CornflowerBlue
CornflowerBlue color (R:100,G:149,B:237,A:255).
Declaration
public static readonly Color CornflowerBlue
Field Value
| Type | Description |
|---|---|
| Color |
Cornsilk
Cornsilk color (R:255,G:248,B:220,A:255).
Declaration
public static readonly Color Cornsilk
Field Value
| Type | Description |
|---|---|
| Color |
Crimson
Crimson color (R:220,G:20,B:60,A:255).
Declaration
public static readonly Color Crimson
Field Value
| Type | Description |
|---|---|
| Color |
Cyan
Cyan color (R:0,G:255,B:255,A:255).
Declaration
public static readonly Color Cyan
Field Value
| Type | Description |
|---|---|
| Color |
DarkBlue
DarkBlue color (R:0,G:0,B:139,A:255).
Declaration
public static readonly Color DarkBlue
Field Value
| Type | Description |
|---|---|
| Color |
DarkCyan
DarkCyan color (R:0,G:139,B:139,A:255).
Declaration
public static readonly Color DarkCyan
Field Value
| Type | Description |
|---|---|
| Color |
DarkGoldenrod
DarkGoldenrod color (R:184,G:134,B:11,A:255).
Declaration
public static readonly Color DarkGoldenrod
Field Value
| Type | Description |
|---|---|
| Color |
DarkGray
DarkGray color (R:169,G:169,B:169,A:255).
Declaration
public static readonly Color DarkGray
Field Value
| Type | Description |
|---|---|
| Color |
DarkGreen
DarkGreen color (R:0,G:100,B:0,A:255).
Declaration
public static readonly Color DarkGreen
Field Value
| Type | Description |
|---|---|
| Color |
DarkKhaki
DarkKhaki color (R:189,G:183,B:107,A:255).
Declaration
public static readonly Color DarkKhaki
Field Value
| Type | Description |
|---|---|
| Color |
DarkMagenta
DarkMagenta color (R:139,G:0,B:139,A:255).
Declaration
public static readonly Color DarkMagenta
Field Value
| Type | Description |
|---|---|
| Color |
DarkOliveGreen
DarkOliveGreen color (R:85,G:107,B:47,A:255).
Declaration
public static readonly Color DarkOliveGreen
Field Value
| Type | Description |
|---|---|
| Color |
DarkOrange
DarkOrange color (R:255,G:140,B:0,A:255).
Declaration
public static readonly Color DarkOrange
Field Value
| Type | Description |
|---|---|
| Color |
DarkOrchid
DarkOrchid color (R:153,G:50,B:204,A:255).
Declaration
public static readonly Color DarkOrchid
Field Value
| Type | Description |
|---|---|
| Color |
DarkRed
DarkRed color (R:139,G:0,B:0,A:255).
Declaration
public static readonly Color DarkRed
Field Value
| Type | Description |
|---|---|
| Color |
DarkSalmon
DarkSalmon color (R:233,G:150,B:122,A:255).
Declaration
public static readonly Color DarkSalmon
Field Value
| Type | Description |
|---|---|
| Color |
DarkSeaGreen
DarkSeaGreen color (R:143,G:188,B:139,A:255).
Declaration
public static readonly Color DarkSeaGreen
Field Value
| Type | Description |
|---|---|
| Color |
DarkSlateBlue
DarkSlateBlue color (R:72,G:61,B:139,A:255).
Declaration
public static readonly Color DarkSlateBlue
Field Value
| Type | Description |
|---|---|
| Color |
DarkSlateGray
DarkSlateGray color (R:47,G:79,B:79,A:255).
Declaration
public static readonly Color DarkSlateGray
Field Value
| Type | Description |
|---|---|
| Color |
DarkTurquoise
DarkTurquoise color (R:0,G:206,B:209,A:255).
Declaration
public static readonly Color DarkTurquoise
Field Value
| Type | Description |
|---|---|
| Color |
DarkViolet
DarkViolet color (R:148,G:0,B:211,A:255).
Declaration
public static readonly Color DarkViolet
Field Value
| Type | Description |
|---|---|
| Color |
DeepPink
DeepPink color (R:255,G:20,B:147,A:255).
Declaration
public static readonly Color DeepPink
Field Value
| Type | Description |
|---|---|
| Color |
DeepSkyBlue
DeepSkyBlue color (R:0,G:191,B:255,A:255).
Declaration
public static readonly Color DeepSkyBlue
Field Value
| Type | Description |
|---|---|
| Color |
DimGray
DimGray color (R:105,G:105,B:105,A:255).
Declaration
public static readonly Color DimGray
Field Value
| Type | Description |
|---|---|
| Color |
DodgerBlue
DodgerBlue color (R:30,G:144,B:255,A:255).
Declaration
public static readonly Color DodgerBlue
Field Value
| Type | Description |
|---|---|
| Color |
Firebrick
Firebrick color (R:178,G:34,B:34,A:255).
Declaration
public static readonly Color Firebrick
Field Value
| Type | Description |
|---|---|
| Color |
FloralWhite
FloralWhite color (R:255,G:250,B:240,A:255).
Declaration
public static readonly Color FloralWhite
Field Value
| Type | Description |
|---|---|
| Color |
ForestGreen
ForestGreen color (R:34,G:139,B:34,A:255).
Declaration
public static readonly Color ForestGreen
Field Value
| Type | Description |
|---|---|
| Color |
Fuchsia
Fuchsia color (R:255,G:0,B:255,A:255).
Declaration
public static readonly Color Fuchsia
Field Value
| Type | Description |
|---|---|
| Color |
Gainsboro
Gainsboro color (R:220,G:220,B:220,A:255).
Declaration
public static readonly Color Gainsboro
Field Value
| Type | Description |
|---|---|
| Color |
GhostWhite
GhostWhite color (R:248,G:248,B:255,A:255).
Declaration
public static readonly Color GhostWhite
Field Value
| Type | Description |
|---|---|
| Color |
Gold
Gold color (R:255,G:215,B:0,A:255).
Declaration
public static readonly Color Gold
Field Value
| Type | Description |
|---|---|
| Color |
Goldenrod
Goldenrod color (R:218,G:165,B:32,A:255).
Declaration
public static readonly Color Goldenrod
Field Value
| Type | Description |
|---|---|
| Color |
Gray
Gray color (R:128,G:128,B:128,A:255).
Declaration
public static readonly Color Gray
Field Value
| Type | Description |
|---|---|
| Color |
Green
Green color (R:0,G:128,B:0,A:255).
Declaration
public static readonly Color Green
Field Value
| Type | Description |
|---|---|
| Color |
GreenYellow
GreenYellow color (R:173,G:255,B:47,A:255).
Declaration
public static readonly Color GreenYellow
Field Value
| Type | Description |
|---|---|
| Color |
Honeydew
Honeydew color (R:240,G:255,B:240,A:255).
Declaration
public static readonly Color Honeydew
Field Value
| Type | Description |
|---|---|
| Color |
HotPink
HotPink color (R:255,G:105,B:180,A:255).
Declaration
public static readonly Color HotPink
Field Value
| Type | Description |
|---|---|
| Color |
IndianRed
IndianRed color (R:205,G:92,B:92,A:255).
Declaration
public static readonly Color IndianRed
Field Value
| Type | Description |
|---|---|
| Color |
Indigo
Indigo color (R:75,G:0,B:130,A:255).
Declaration
public static readonly Color Indigo
Field Value
| Type | Description |
|---|---|
| Color |
Ivory
Ivory color (R:255,G:255,B:240,A:255).
Declaration
public static readonly Color Ivory
Field Value
| Type | Description |
|---|---|
| Color |
Khaki
Khaki color (R:240,G:230,B:140,A:255).
Declaration
public static readonly Color Khaki
Field Value
| Type | Description |
|---|---|
| Color |
Lavender
Lavender color (R:230,G:230,B:250,A:255).
Declaration
public static readonly Color Lavender
Field Value
| Type | Description |
|---|---|
| Color |
LavenderBlush
LavenderBlush color (R:255,G:240,B:245,A:255).
Declaration
public static readonly Color LavenderBlush
Field Value
| Type | Description |
|---|---|
| Color |
LawnGreen
LawnGreen color (R:124,G:252,B:0,A:255).
Declaration
public static readonly Color LawnGreen
Field Value
| Type | Description |
|---|---|
| Color |
LemonChiffon
LemonChiffon color (R:255,G:250,B:205,A:255).
Declaration
public static readonly Color LemonChiffon
Field Value
| Type | Description |
|---|---|
| Color |
LightBlue
LightBlue color (R:173,G:216,B:230,A:255).
Declaration
public static readonly Color LightBlue
Field Value
| Type | Description |
|---|---|
| Color |
LightCoral
LightCoral color (R:240,G:128,B:128,A:255).
Declaration
public static readonly Color LightCoral
Field Value
| Type | Description |
|---|---|
| Color |
LightCyan
LightCyan color (R:224,G:255,B:255,A:255).
Declaration
public static readonly Color LightCyan
Field Value
| Type | Description |
|---|---|
| Color |
LightGoldenrodYellow
LightGoldenrodYellow color (R:250,G:250,B:210,A:255).
Declaration
public static readonly Color LightGoldenrodYellow
Field Value
| Type | Description |
|---|---|
| Color |
LightGray
LightGray color (R:211,G:211,B:211,A:255).
Declaration
public static readonly Color LightGray
Field Value
| Type | Description |
|---|---|
| Color |
LightGreen
LightGreen color (R:144,G:238,B:144,A:255).
Declaration
public static readonly Color LightGreen
Field Value
| Type | Description |
|---|---|
| Color |
LightPink
LightPink color (R:255,G:182,B:193,A:255).
Declaration
public static readonly Color LightPink
Field Value
| Type | Description |
|---|---|
| Color |
LightSalmon
LightSalmon color (R:255,G:160,B:122,A:255).
Declaration
public static readonly Color LightSalmon
Field Value
| Type | Description |
|---|---|
| Color |
LightSeaGreen
LightSeaGreen color (R:32,G:178,B:170,A:255).
Declaration
public static readonly Color LightSeaGreen
Field Value
| Type | Description |
|---|---|
| Color |
LightSkyBlue
LightSkyBlue color (R:135,G:206,B:250,A:255).
Declaration
public static readonly Color LightSkyBlue
Field Value
| Type | Description |
|---|---|
| Color |
LightSlateGray
LightSlateGray color (R:119,G:136,B:153,A:255).
Declaration
public static readonly Color LightSlateGray
Field Value
| Type | Description |
|---|---|
| Color |
LightSteelBlue
LightSteelBlue color (R:176,G:196,B:222,A:255).
Declaration
public static readonly Color LightSteelBlue
Field Value
| Type | Description |
|---|---|
| Color |
LightYellow
LightYellow color (R:255,G:255,B:224,A:255).
Declaration
public static readonly Color LightYellow
Field Value
| Type | Description |
|---|---|
| Color |
Lime
Lime color (R:0,G:255,B:0,A:255).
Declaration
public static readonly Color Lime
Field Value
| Type | Description |
|---|---|
| Color |
LimeGreen
LimeGreen color (R:50,G:205,B:50,A:255).
Declaration
public static readonly Color LimeGreen
Field Value
| Type | Description |
|---|---|
| Color |
Linen
Linen color (R:250,G:240,B:230,A:255).
Declaration
public static readonly Color Linen
Field Value
| Type | Description |
|---|---|
| Color |
Magenta
Magenta color (R:255,G:0,B:255,A:255).
Declaration
public static readonly Color Magenta
Field Value
| Type | Description |
|---|---|
| Color |
Maroon
Maroon color (R:128,G:0,B:0,A:255).
Declaration
public static readonly Color Maroon
Field Value
| Type | Description |
|---|---|
| Color |
MediumAquamarine
MediumAquamarine color (R:102,G:205,B:170,A:255).
Declaration
public static readonly Color MediumAquamarine
Field Value
| Type | Description |
|---|---|
| Color |
MediumBlue
MediumBlue color (R:0,G:0,B:205,A:255).
Declaration
public static readonly Color MediumBlue
Field Value
| Type | Description |
|---|---|
| Color |
MediumOrchid
MediumOrchid color (R:186,G:85,B:211,A:255).
Declaration
public static readonly Color MediumOrchid
Field Value
| Type | Description |
|---|---|
| Color |
MediumPurple
MediumPurple color (R:147,G:112,B:219,A:255).
Declaration
public static readonly Color MediumPurple
Field Value
| Type | Description |
|---|---|
| Color |
MediumSeaGreen
MediumSeaGreen color (R:60,G:179,B:113,A:255).
Declaration
public static readonly Color MediumSeaGreen
Field Value
| Type | Description |
|---|---|
| Color |
MediumSlateBlue
MediumSlateBlue color (R:123,G:104,B:238,A:255).
Declaration
public static readonly Color MediumSlateBlue
Field Value
| Type | Description |
|---|---|
| Color |
MediumSpringGreen
MediumSpringGreen color (R:0,G:250,B:154,A:255).
Declaration
public static readonly Color MediumSpringGreen
Field Value
| Type | Description |
|---|---|
| Color |
MediumTurquoise
MediumTurquoise color (R:72,G:209,B:204,A:255).
Declaration
public static readonly Color MediumTurquoise
Field Value
| Type | Description |
|---|---|
| Color |
MediumVioletRed
MediumVioletRed color (R:199,G:21,B:133,A:255).
Declaration
public static readonly Color MediumVioletRed
Field Value
| Type | Description |
|---|---|
| Color |
MidnightBlue
MidnightBlue color (R:25,G:25,B:112,A:255).
Declaration
public static readonly Color MidnightBlue
Field Value
| Type | Description |
|---|---|
| Color |
MintCream
MintCream color (R:245,G:255,B:250,A:255).
Declaration
public static readonly Color MintCream
Field Value
| Type | Description |
|---|---|
| Color |
MistyRose
MistyRose color (R:255,G:228,B:225,A:255).
Declaration
public static readonly Color MistyRose
Field Value
| Type | Description |
|---|---|
| Color |
Moccasin
Moccasin color (R:255,G:228,B:181,A:255).
Declaration
public static readonly Color Moccasin
Field Value
| Type | Description |
|---|---|
| Color |
MonoGameOrange
MonoGame orange theme color (R:231,G:60,B:0,A:255).
Declaration
public static readonly Color MonoGameOrange
Field Value
| Type | Description |
|---|---|
| Color |
NavajoWhite
NavajoWhite color (R:255,G:222,B:173,A:255).
Declaration
public static readonly Color NavajoWhite
Field Value
| Type | Description |
|---|---|
| Color |
Navy
Navy color (R:0,G:0,B:128,A:255).
Declaration
public static readonly Color Navy
Field Value
| Type | Description |
|---|---|
| Color |
OldLace
OldLace color (R:253,G:245,B:230,A:255).
Declaration
public static readonly Color OldLace
Field Value
| Type | Description |
|---|---|
| Color |
Olive
Olive color (R:128,G:128,B:0,A:255).
Declaration
public static readonly Color Olive
Field Value
| Type | Description |
|---|---|
| Color |
OliveDrab
OliveDrab color (R:107,G:142,B:35,A:255).
Declaration
public static readonly Color OliveDrab
Field Value
| Type | Description |
|---|---|
| Color |
Orange
Orange color (R:255,G:165,B:0,A:255).
Declaration
public static readonly Color Orange
Field Value
| Type | Description |
|---|---|
| Color |
OrangeRed
OrangeRed color (R:255,G:69,B:0,A:255).
Declaration
public static readonly Color OrangeRed
Field Value
| Type | Description |
|---|---|
| Color |
Orchid
Orchid color (R:218,G:112,B:214,A:255).
Declaration
public static readonly Color Orchid
Field Value
| Type | Description |
|---|---|
| Color |
PaleGoldenrod
PaleGoldenrod color (R:238,G:232,B:170,A:255).
Declaration
public static readonly Color PaleGoldenrod
Field Value
| Type | Description |
|---|---|
| Color |
PaleGreen
PaleGreen color (R:152,G:251,B:152,A:255).
Declaration
public static readonly Color PaleGreen
Field Value
| Type | Description |
|---|---|
| Color |
PaleTurquoise
PaleTurquoise color (R:175,G:238,B:238,A:255).
Declaration
public static readonly Color PaleTurquoise
Field Value
| Type | Description |
|---|---|
| Color |
PaleVioletRed
PaleVioletRed color (R:219,G:112,B:147,A:255).
Declaration
public static readonly Color PaleVioletRed
Field Value
| Type | Description |
|---|---|
| Color |
PapayaWhip
PapayaWhip color (R:255,G:239,B:213,A:255).
Declaration
public static readonly Color PapayaWhip
Field Value
| Type | Description |
|---|---|
| Color |
PeachPuff
PeachPuff color (R:255,G:218,B:185,A:255).
Declaration
public static readonly Color PeachPuff
Field Value
| Type | Description |
|---|---|
| Color |
Peru
Peru color (R:205,G:133,B:63,A:255).
Declaration
public static readonly Color Peru
Field Value
| Type | Description |
|---|---|
| Color |
Pink
Pink color (R:255,G:192,B:203,A:255).
Declaration
public static readonly Color Pink
Field Value
| Type | Description |
|---|---|
| Color |
Plum
Plum color (R:221,G:160,B:221,A:255).
Declaration
public static readonly Color Plum
Field Value
| Type | Description |
|---|---|
| Color |
PowderBlue
PowderBlue color (R:176,G:224,B:230,A:255).
Declaration
public static readonly Color PowderBlue
Field Value
| Type | Description |
|---|---|
| Color |
Purple
Purple color (R:128,G:0,B:128,A:255).
Declaration
public static readonly Color Purple
Field Value
| Type | Description |
|---|---|
| Color |
Red
Red color (R:255,G:0,B:0,A:255).
Declaration
public static readonly Color Red
Field Value
| Type | Description |
|---|---|
| Color |
RosyBrown
RosyBrown color (R:188,G:143,B:143,A:255).
Declaration
public static readonly Color RosyBrown
Field Value
| Type | Description |
|---|---|
| Color |
RoyalBlue
RoyalBlue color (R:65,G:105,B:225,A:255).
Declaration
public static readonly Color RoyalBlue
Field Value
| Type | Description |
|---|---|
| Color |
SaddleBrown
SaddleBrown color (R:139,G:69,B:19,A:255).
Declaration
public static readonly Color SaddleBrown
Field Value
| Type | Description |
|---|---|
| Color |
Salmon
Salmon color (R:250,G:128,B:114,A:255).
Declaration
public static readonly Color Salmon
Field Value
| Type | Description |
|---|---|
| Color |
SandyBrown
SandyBrown color (R:244,G:164,B:96,A:255).
Declaration
public static readonly Color SandyBrown
Field Value
| Type | Description |
|---|---|
| Color |
SeaGreen
SeaGreen color (R:46,G:139,B:87,A:255).
Declaration
public static readonly Color SeaGreen
Field Value
| Type | Description |
|---|---|
| Color |
SeaShell
SeaShell color (R:255,G:245,B:238,A:255).
Declaration
public static readonly Color SeaShell
Field Value
| Type | Description |
|---|---|
| Color |
Sienna
Sienna color (R:160,G:82,B:45,A:255).
Declaration
public static readonly Color Sienna
Field Value
| Type | Description |
|---|---|
| Color |
Silver
Silver color (R:192,G:192,B:192,A:255).
Declaration
public static readonly Color Silver
Field Value
| Type | Description |
|---|---|
| Color |
SkyBlue
SkyBlue color (R:135,G:206,B:235,A:255).
Declaration
public static readonly Color SkyBlue
Field Value
| Type | Description |
|---|---|
| Color |
SlateBlue
SlateBlue color (R:106,G:90,B:205,A:255).
Declaration
public static readonly Color SlateBlue
Field Value
| Type | Description |
|---|---|
| Color |
SlateGray
SlateGray color (R:112,G:128,B:144,A:255).
Declaration
public static readonly Color SlateGray
Field Value
| Type | Description |
|---|---|
| Color |
Snow
Snow color (R:255,G:250,B:250,A:255).
Declaration
public static readonly Color Snow
Field Value
| Type | Description |
|---|---|
| Color |
SpringGreen
SpringGreen color (R:0,G:255,B:127,A:255).
Declaration
public static readonly Color SpringGreen
Field Value
| Type | Description |
|---|---|
| Color |
SteelBlue
SteelBlue color (R:70,G:130,B:180,A:255).
Declaration
public static readonly Color SteelBlue
Field Value
| Type | Description |
|---|---|
| Color |
Tan
Tan color (R:210,G:180,B:140,A:255).
Declaration
public static readonly Color Tan
Field Value
| Type | Description |
|---|---|
| Color |
Teal
Teal color (R:0,G:128,B:128,A:255).
Declaration
public static readonly Color Teal
Field Value
| Type | Description |
|---|---|
| Color |
Thistle
Thistle color (R:216,G:191,B:216,A:255).
Declaration
public static readonly Color Thistle
Field Value
| Type | Description |
|---|---|
| Color |
Tomato
Tomato color (R:255,G:99,B:71,A:255).
Declaration
public static readonly Color Tomato
Field Value
| Type | Description |
|---|---|
| Color |
Transparent
Transparent color (R:0,G:0,B:0,A:0).
Declaration
public static readonly Color Transparent
Field Value
| Type | Description |
|---|---|
| Color |
TransparentBlack
TransparentBlack color (R:0,G:0,B:0,A:0).
Declaration
public static readonly Color TransparentBlack
Field Value
| Type | Description |
|---|---|
| Color |
Turquoise
Turquoise color (R:64,G:224,B:208,A:255).
Declaration
public static readonly Color Turquoise
Field Value
| Type | Description |
|---|---|
| Color |
Violet
Violet color (R:238,G:130,B:238,A:255).
Declaration
public static readonly Color Violet
Field Value
| Type | Description |
|---|---|
| Color |
Wheat
Wheat color (R:245,G:222,B:179,A:255).
Declaration
public static readonly Color Wheat
Field Value
| Type | Description |
|---|---|
| Color |
White
White color (R:255,G:255,B:255,A:255).
Declaration
public static readonly Color White
Field Value
| Type | Description |
|---|---|
| Color |
WhiteSmoke
WhiteSmoke color (R:245,G:245,B:245,A:255).
Declaration
public static readonly Color WhiteSmoke
Field Value
| Type | Description |
|---|---|
| Color |
Yellow
Yellow color (R:255,G:255,B:0,A:255).
Declaration
public static readonly Color Yellow
Field Value
| Type | Description |
|---|---|
| Color |
YellowGreen
YellowGreen color (R:154,G:205,B:50,A:255).
Declaration
public static readonly Color YellowGreen
Field Value
| Type | Description |
|---|---|
| Color |
Properties
A
Gets or sets the alpha component.
Declaration
public byte A { get; }
Property Value
| Type | Description |
|---|---|
| Byte |
B
Gets or sets the blue component.
Declaration
public byte B { get; }
Property Value
| Type | Description |
|---|---|
| Byte |
G
Gets or sets the green component.
Declaration
public byte G { get; }
Property Value
| Type | Description |
|---|---|
| Byte |
PackedValue
Gets the packed value of this Color.
Declaration
public uint PackedValue { get; }
Property Value
| Type | Description |
|---|---|
| UInt32 |
R
Gets or sets the red component.
Declaration
public byte R { get; }
Property Value
| Type | Description |
|---|---|
| Byte |
Methods
Deconstruct(out Byte, out Byte, out Byte)
Deconstruction method for Color.
Declaration
public void Deconstruct(out byte r, out byte g, out byte b)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | r | |
| Byte | g | |
| Byte | b |
Deconstruct(out Byte, out Byte, out Byte, out Byte)
Deconstruction method for Color with Alpha.
Declaration
public void Deconstruct(out byte r, out byte g, out byte b, out byte a)
Parameters
| Type | Name | Description |
|---|---|---|
| Byte | r | |
| Byte | g | |
| Byte | b | |
| Byte | a |
Deconstruct(out Int32, out Int32, out Int32)
Deconstruction method for Color.
Declaration
public void Deconstruct(out int r, out int g, out int b)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | r | |
| Int32 | g | |
| Int32 | b |
Deconstruct(out Int32, out Int32, out Int32, out Int32)
Deconstruction method for Color with Alpha.
Declaration
public void Deconstruct(out int r, out int g, out int b, out int a)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | r | |
| Int32 | g | |
| Int32 | b | |
| Int32 | a |
Deconstruct(out Single, out Single, out Single)
Deconstruction method for Color.
Declaration
public void Deconstruct(out float r, out float g, out float b)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | r | |
| Single | g | |
| Single | b |
Deconstruct(out Single, out Single, out Single, out Single)
Deconstruction method for Color with Alpha.
Declaration
public void Deconstruct(out float r, out float g, out float b, out float a)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | r | |
| Single | g | |
| Single | b | |
| Single | a |
Equals(Color)
Compares whether current instance is equal to specified Color.
Declaration
public bool Equals(Color other)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | other | The Color to compare. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Equals(Object)
Compares whether current instance is equal to specified object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Object | obj | The Color to compare. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
FromHSL(Single, Single, Single)
Creates a Color from the specified hue, saturation, lightness, and alpha values. Taken from the MIT licensed Windows Community Toolkit: https://github.com/CommunityToolkit/WindowsCommunityToolkit/blob/63cbb4a51bdef59083ccfc86bbcba41f966d0027/Microsoft.Toolkit.Uwp/Helpers/ColorHelper.cs#L246
Declaration
public static Color FromHSL(float h, float s, float l)
Parameters
| Type | Name | Description |
|---|---|---|
| Single | h | 0..360 range hue |
| Single | s | 0..1 range saturation |
| Single | l | 0..1 range lightness |
Returns
| Type | Description |
|---|---|
| Color | The created Color. |
FromNonPremultiplied(Int32, Int32, Int32, Int32)
Declaration
public static Color FromNonPremultiplied(int r, int g, int b, int a)
Parameters
| Type | Name | Description |
|---|---|---|
| Int32 | r | Red component value. |
| Int32 | g | Green component value. |
| Int32 | b | Blue component value. |
| Int32 | a | Alpha component value. |
Returns
| Type | Description |
|---|---|
| Color | A Color which contains premultiplied alpha data. |
GetBrightness()
Gets the lightness of a color (as defined by the HSL color space).
Declaration
public float GetBrightness()
Returns
| Type | Description |
|---|---|
| Single | The lightness value. |
Remarks
This function exists largely for historical reasons; use GetHSLLightness and GetHSVBrightness instead.
GetHashCode()
Gets the hash code of this Color.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| Int32 | Hash code of this Color. |
GetHSLHue()
Gets the hue of a color (as defined by the HSL color space).
Declaration
public float GetHSLHue()
Returns
| Type | Description |
|---|---|
| Single | The hue value. |
GetHSLLightness()
Gets the lightness of a color (as defined by the HSL color space).
Declaration
public float GetHSLLightness()
Returns
| Type | Description |
|---|---|
| Single | The lightness value. |
GetHSLSaturation()
Gets the saturation of a color (as defined by the HSL color space).
Declaration
public float GetHSLSaturation()
Returns
| Type | Description |
|---|---|
| Single | The saturation value. |
GetHSVBrightness()
Gets the brightness of a color (as defined by the HSV color space).
Declaration
public float GetHSVBrightness()
Returns
| Type | Description |
|---|---|
| Single | The brightness value. |
GetHSVHue()
Gets the hue of a color (as defined by the HSV color space).
Declaration
public float GetHSVHue()
Returns
| Type | Description |
|---|---|
| Single | The hue value. |
GetHSVSaturation()
Gets the saturation of a color (as defined by the HSL color space).
Declaration
public float GetHSVSaturation()
Returns
| Type | Description |
|---|---|
| Single | The saturation value. |
GetHue()
Gets the hue of a color (as defined by the HSL color space).
Declaration
public float GetHue()
Returns
| Type | Description |
|---|---|
| Single | The hue value. |
Remarks
This function exists largely for historical reason; use GetHSLHue and GetHSVHue instead.
GetLuma()
Gets the luma of an existing color.
Declaration
public float GetLuma()
Returns
| Type | Description |
|---|---|
| Single | A value based on this code: (color.R + color.R + color.B + color.G + color.G + color.G) / 6f |
GetSaturation()
Gets the saturation of a color (as defined by the HSL color space).
Declaration
public float GetSaturation()
Returns
| Type | Description |
|---|---|
| Single | The saturation value. |
Remarks
This function exists largely for historical reason; use GetHSLSaturation and GetHSVSaturation instead.
Lerp(Color, Color, Single)
Performs linear interpolation of Color.
Declaration
public static Color Lerp(Color value1, Color value2, float amount)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | value1 | Source Color. |
| Color | value2 | Destination Color. |
| Single | amount | Interpolation factor. |
Returns
| Type | Description |
|---|---|
| Color | Interpolated Color. |
LerpSteps(Color, Color, Int32)
Creates an array of colors that includes the startingColor and endingColor and steps of colors between them.
Declaration
public static Color[] LerpSteps(Color startingColor, Color endingColor, int steps)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | startingColor | The starting color which will be at index 0 in the array. |
| Color | endingColor | The ending color which will be at index |
| Int32 | steps | The gradient steps in the array which uses Lerp(Color, Color, Single). |
Returns
| Type | Description |
|---|---|
| Color[] | An array of colors. |
Matches(Color)
Returns true if the colors represent the same color values.
Declaration
public bool Matches(Color other)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | other |
Returns
| Type | Description |
|---|---|
| Boolean |
Multiply(Color, Single)
Multiply Color by value.
Declaration
public static Color Multiply(Color value, float scale)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | value | Source Color. |
| Single | scale | Multiplicator. |
Returns
| Type | Description |
|---|---|
| Color | Multiplication result. |
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| String |
Operators
Equality(Color, Color)
Compares whether two Color instances are equal.
Declaration
public static bool operator ==(Color a, Color b)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | a | Color instance on the left of the equal sign. |
| Color | b | Color instance on the right of the equal sign. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Inequality(Color, Color)
Compares whether two Color instances are not equal.
Declaration
public static bool operator !=(Color a, Color b)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | a | Color instance on the left of the not equal sign. |
| Color | b | Color instance on the right of the not equal sign. |
Returns
| Type | Description |
|---|---|
| Boolean |
|
Multiply(Color, Single)
Multiply Color by value.
Declaration
public static Color operator *(Color value, float scale)
Parameters
| Type | Name | Description |
|---|---|---|
| Color | value | Source Color. |
| Single | scale | Multiplicator. |
Returns
| Type | Description |
|---|---|
| Color | Multiplication result. |