Color Structure (Microsoft.Xna.Framework)

Describes a 32-bit packed color.

Namespace: Microsoft.Xna.Framework
Assembly: MonoGame.Framework (MonoGame.Framework.dll 3.8.0.1082)
  • C#
  • VB
  • F#
[DataContractAttribute]
[DebuggerDisplayAttribute("{DebugDisplayString,nq}")]
[StructLayoutAttribute(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = -1, Size = -1)]
public struct Color : IEquatable<Color>

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

The Color type exposes the following members.

  Platforms Name Description
Color(uint) Constructs an RGBA color from a packed value. The value is a 32-bit unsigned integer, with R in the least significant octet. 
Color(Vector4) Constructs an RGBA color from the XYZW unit length components of a vector. 
Color(Vector3) Constructs an RGBA color from the XYZ unit length components of a vector. Alpha value will be opaque. 
Color(Color, int) Constructs an RGBA color from a Color and an alpha value. 
Color(Color, float) Constructs an RGBA color from color and alpha value. 
Color(float, float, float) Constructs an RGBA color from scalars representing red, green and blue values. Alpha value will be opaque. 
Color(float, float, float, float) Constructs an RGBA color from scalars representing red, green, blue and alpha values. 
Color(int, int, int) Constructs an RGBA color from scalars representing red, green and blue values. Alpha value will be opaque. 
Color(int, int, int, int) Constructs an RGBA color from scalars representing red, green, blue and alpha values. 
Color(Byte, Byte, Byte, Byte) Constructs an RGBA color from scalars representing red, green, blue and alpha values. 
Top
  Platforms Name Description
A Gets or sets the alpha component. 
AliceBlue AliceBlue color (R:240,G:248,B:255,A:255). 
AntiqueWhite AntiqueWhite color (R:250,G:235,B:215,A:255). 
Aqua Aqua color (R:0,G:255,B:255,A:255). 
Aquamarine Aquamarine color (R:127,G:255,B:212,A:255). 
Azure Azure color (R:240,G:255,B:255,A:255). 
B Gets or sets the blue component. 
Beige Beige color (R:245,G:245,B:220,A:255). 
Bisque Bisque color (R:255,G:228,B:196,A:255). 
Black Black color (R:0,G:0,B:0,A:255). 
BlanchedAlmond BlanchedAlmond color (R:255,G:235,B:205,A:255). 
Blue Blue color (R:0,G:0,B:255,A:255). 
BlueViolet BlueViolet color (R:138,G:43,B:226,A:255). 
Brown Brown color (R:165,G:42,B:42,A:255). 
BurlyWood BurlyWood color (R:222,G:184,B:135,A:255). 
CadetBlue CadetBlue color (R:95,G:158,B:160,A:255). 
Chartreuse Chartreuse color (R:127,G:255,B:0,A:255). 
Chocolate Chocolate color (R:210,G:105,B:30,A:255). 
Coral Coral color (R:255,G:127,B:80,A:255). 
CornflowerBlue CornflowerBlue color (R:100,G:149,B:237,A:255). 
Cornsilk Cornsilk color (R:255,G:248,B:220,A:255). 
Crimson Crimson color (R:220,G:20,B:60,A:255). 
Cyan Cyan color (R:0,G:255,B:255,A:255). 
DarkBlue DarkBlue color (R:0,G:0,B:139,A:255). 
DarkCyan DarkCyan color (R:0,G:139,B:139,A:255). 
DarkGoldenrod DarkGoldenrod color (R:184,G:134,B:11,A:255). 
DarkGray DarkGray color (R:169,G:169,B:169,A:255). 
DarkGreen DarkGreen color (R:0,G:100,B:0,A:255). 
DarkKhaki DarkKhaki color (R:189,G:183,B:107,A:255). 
DarkMagenta DarkMagenta color (R:139,G:0,B:139,A:255). 
DarkOliveGreen DarkOliveGreen color (R:85,G:107,B:47,A:255). 
DarkOrange DarkOrange color (R:255,G:140,B:0,A:255). 
DarkOrchid DarkOrchid color (R:153,G:50,B:204,A:255). 
DarkRed DarkRed color (R:139,G:0,B:0,A:255). 
DarkSalmon DarkSalmon color (R:233,G:150,B:122,A:255). 
DarkSeaGreen DarkSeaGreen color (R:143,G:188,B:139,A:255). 
DarkSlateBlue DarkSlateBlue color (R:72,G:61,B:139,A:255). 
DarkSlateGray DarkSlateGray color (R:47,G:79,B:79,A:255). 
DarkTurquoise DarkTurquoise color (R:0,G:206,B:209,A:255). 
DarkViolet DarkViolet color (R:148,G:0,B:211,A:255). 
DeepPink DeepPink color (R:255,G:20,B:147,A:255). 
DeepSkyBlue DeepSkyBlue color (R:0,G:191,B:255,A:255). 
DimGray DimGray color (R:105,G:105,B:105,A:255). 
DodgerBlue DodgerBlue color (R:30,G:144,B:255,A:255). 
Firebrick Firebrick color (R:178,G:34,B:34,A:255). 
FloralWhite FloralWhite color (R:255,G:250,B:240,A:255). 
ForestGreen ForestGreen color (R:34,G:139,B:34,A:255). 
Fuchsia Fuchsia color (R:255,G:0,B:255,A:255). 
G Gets or sets the green component. 
Gainsboro Gainsboro color (R:220,G:220,B:220,A:255). 
GhostWhite GhostWhite color (R:248,G:248,B:255,A:255). 
Gold Gold color (R:255,G:215,B:0,A:255). 
Goldenrod Goldenrod color (R:218,G:165,B:32,A:255). 
Gray Gray color (R:128,G:128,B:128,A:255). 
Green Green color (R:0,G:128,B:0,A:255). 
GreenYellow GreenYellow color (R:173,G:255,B:47,A:255). 
Honeydew Honeydew color (R:240,G:255,B:240,A:255). 
HotPink HotPink color (R:255,G:105,B:180,A:255). 
IndianRed IndianRed color (R:205,G:92,B:92,A:255). 
Indigo Indigo color (R:75,G:0,B:130,A:255). 
Ivory Ivory color (R:255,G:255,B:240,A:255). 
Khaki Khaki color (R:240,G:230,B:140,A:255). 
Lavender Lavender color (R:230,G:230,B:250,A:255). 
LavenderBlush LavenderBlush color (R:255,G:240,B:245,A:255). 
LawnGreen LawnGreen color (R:124,G:252,B:0,A:255). 
LemonChiffon LemonChiffon color (R:255,G:250,B:205,A:255). 
LightBlue LightBlue color (R:173,G:216,B:230,A:255). 
LightCoral LightCoral color (R:240,G:128,B:128,A:255). 
LightCyan LightCyan color (R:224,G:255,B:255,A:255). 
LightGoldenrodYellow LightGoldenrodYellow color (R:250,G:250,B:210,A:255). 
LightGray LightGray color (R:211,G:211,B:211,A:255). 
LightGreen LightGreen color (R:144,G:238,B:144,A:255). 
LightPink LightPink color (R:255,G:182,B:193,A:255). 
LightSalmon LightSalmon color (R:255,G:160,B:122,A:255). 
LightSeaGreen LightSeaGreen color (R:32,G:178,B:170,A:255). 
LightSkyBlue LightSkyBlue color (R:135,G:206,B:250,A:255). 
LightSlateGray LightSlateGray color (R:119,G:136,B:153,A:255). 
LightSteelBlue LightSteelBlue color (R:176,G:196,B:222,A:255). 
LightYellow LightYellow color (R:255,G:255,B:224,A:255). 
Lime Lime color (R:0,G:255,B:0,A:255). 
LimeGreen LimeGreen color (R:50,G:205,B:50,A:255). 
Linen Linen color (R:250,G:240,B:230,A:255). 
Magenta Magenta color (R:255,G:0,B:255,A:255). 
Maroon Maroon color (R:128,G:0,B:0,A:255). 
MediumAquamarine MediumAquamarine color (R:102,G:205,B:170,A:255). 
MediumBlue MediumBlue color (R:0,G:0,B:205,A:255). 
MediumOrchid MediumOrchid color (R:186,G:85,B:211,A:255). 
MediumPurple MediumPurple color (R:147,G:112,B:219,A:255). 
MediumSeaGreen MediumSeaGreen color (R:60,G:179,B:113,A:255). 
MediumSlateBlue MediumSlateBlue color (R:123,G:104,B:238,A:255). 
MediumSpringGreen MediumSpringGreen color (R:0,G:250,B:154,A:255). 
MediumTurquoise MediumTurquoise color (R:72,G:209,B:204,A:255). 
MediumVioletRed MediumVioletRed color (R:199,G:21,B:133,A:255). 
MidnightBlue MidnightBlue color (R:25,G:25,B:112,A:255). 
MintCream MintCream color (R:245,G:255,B:250,A:255). 
MistyRose MistyRose color (R:255,G:228,B:225,A:255). 
Moccasin Moccasin color (R:255,G:228,B:181,A:255). 
MonoGameOrange MonoGame orange theme color (R:231,G:60,B:0,A:255). 
NavajoWhite NavajoWhite color (R:255,G:222,B:173,A:255). 
Navy Navy color (R:0,G:0,B:128,A:255). 
OldLace OldLace color (R:253,G:245,B:230,A:255). 
Olive Olive color (R:128,G:128,B:0,A:255). 
OliveDrab OliveDrab color (R:107,G:142,B:35,A:255). 
Orange Orange color (R:255,G:165,B:0,A:255). 
OrangeRed OrangeRed color (R:255,G:69,B:0,A:255). 
Orchid Orchid color (R:218,G:112,B:214,A:255). 
PackedValue Gets or sets packed value of this Color
PaleGoldenrod PaleGoldenrod color (R:238,G:232,B:170,A:255). 
PaleGreen PaleGreen color (R:152,G:251,B:152,A:255). 
PaleTurquoise PaleTurquoise color (R:175,G:238,B:238,A:255). 
PaleVioletRed PaleVioletRed color (R:219,G:112,B:147,A:255). 
PapayaWhip PapayaWhip color (R:255,G:239,B:213,A:255). 
PeachPuff PeachPuff color (R:255,G:218,B:185,A:255). 
Peru Peru color (R:205,G:133,B:63,A:255). 
Pink Pink color (R:255,G:192,B:203,A:255). 
Plum Plum color (R:221,G:160,B:221,A:255). 
PowderBlue PowderBlue color (R:176,G:224,B:230,A:255). 
Purple Purple color (R:128,G:0,B:128,A:255). 
R Gets or sets the red component. 
Red Red color (R:255,G:0,B:0,A:255). 
RosyBrown RosyBrown color (R:188,G:143,B:143,A:255). 
RoyalBlue RoyalBlue color (R:65,G:105,B:225,A:255). 
SaddleBrown SaddleBrown color (R:139,G:69,B:19,A:255). 
Salmon Salmon color (R:250,G:128,B:114,A:255). 
SandyBrown SandyBrown color (R:244,G:164,B:96,A:255). 
SeaGreen SeaGreen color (R:46,G:139,B:87,A:255). 
SeaShell SeaShell color (R:255,G:245,B:238,A:255). 
Sienna Sienna color (R:160,G:82,B:45,A:255). 
Silver Silver color (R:192,G:192,B:192,A:255). 
SkyBlue SkyBlue color (R:135,G:206,B:235,A:255). 
SlateBlue SlateBlue color (R:106,G:90,B:205,A:255). 
SlateGray SlateGray color (R:112,G:128,B:144,A:255). 
Snow Snow color (R:255,G:250,B:250,A:255). 
SpringGreen SpringGreen color (R:0,G:255,B:127,A:255). 
SteelBlue SteelBlue color (R:70,G:130,B:180,A:255). 
Tan Tan color (R:210,G:180,B:140,A:255). 
Teal Teal color (R:0,G:128,B:128,A:255). 
Thistle Thistle color (R:216,G:191,B:216,A:255). 
Tomato Tomato color (R:255,G:99,B:71,A:255). 
Transparent Transparent color (R:0,G:0,B:0,A:0). 
TransparentBlack TransparentBlack color (R:0,G:0,B:0,A:0). 
Turquoise Turquoise color (R:64,G:224,B:208,A:255). 
Violet Violet color (R:238,G:130,B:238,A:255). 
Wheat Wheat color (R:245,G:222,B:179,A:255). 
White White color (R:255,G:255,B:255,A:255). 
WhiteSmoke WhiteSmoke color (R:245,G:245,B:245,A:255). 
Yellow Yellow color (R:255,G:255,B:0,A:255). 
YellowGreen YellowGreen color (R:154,G:205,B:50,A:255). 
Top
  Platforms Name Description
Deconstruct(out Single, out Single, out Single, out Single) Deconstruction method for Color with Alpha. 
Deconstruct(out Single, out Single, out Single) Deconstruction method for Color
Equals(Color) Compares whether current instance is equal to specified Color. (Implements IEquatable<T>.Equals().)
Equals(object) Compares whether current instance is equal to specified object. (Overrides ValueType.Equals().)
FromNonPremultiplied(int, int, int, int) Translate a non-premultipled alpha Color to a Color that contains premultiplied alpha. 
FromNonPremultiplied(Vector4) Translate a non-premultipled alpha Color to a Color that contains premultiplied alpha. 
GetHashCode Gets the hash code of this Color. (Overrides ValueType.GetHashCode().)
Lerp Performs linear interpolation of Color
LerpPrecise Lerp(Color, Color, float) should be used instead of this function. 
Multiply(Color, float) Multiply Color by value. 
ToString Returns a System.String representation of this Color in the format: {R:[red] G:[green] B:[blue] A:[alpha]} (Overrides ValueType.ToString().)
ToVector3 Gets a Vector3 representation for this object. 
ToVector4 Gets a Vector4 representation for this object. 
Top
  Platforms Name Description
Equality Compares whether two Color instances are equal. 
Inequality Compares whether two Color instances are not equal. 
Multiply(Color, float) Multiply Color by value. 
Multiply(float, Color)  
Top
Supported in:

    
 Windows DirectX Desktop
    
 Linux Desktop
    
 Windows OpenGL Desktop
    
 Web