Color Structure

Represents a four-component color using red, green, blue, and alpha data.

Namespace:  Microsoft.Xna.Framework
Assembly:  Microsoft.Xna.Framework (in Microsoft.Xna.Framework.dll)

public struct Color

The Color type exposes the following members.

  NameDescription
Public methodColor(Int32, Int32, Int32)Initializes a new instance of the Color structure using integer values.
Public methodColor(Single, Single, Single)Initializes a new instance of the Color structure using floating point values.
Public methodColor(Int32, Int32, Int32, Int32)Initializes a new instance of the Color structure using integer values.
Public methodColor(Single, Single, Single, Single)Initializes a new instance of the Color structure using floating point values.
Top

  NameDescription
Public propertyAGets or sets the alpha component value.
Public propertyBGets or sets the blue component value.
Public propertyStatic memberBlackGets a system-defined color with the value R:0 G:0 B:0 A:255.
Public propertyGGets or sets the green component value
Public propertyPackedValueGets the current color as a packed value.
Public propertyRGets or sets the red component value.
Public propertyStatic memberTransparentGets a system-defined color with the value R:0 G:0 B:0 A:0.
Public propertyStatic memberWhiteGets a system-defined color with the value R:255 G:255 B:255 A:255.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified color object equals this object. (Overrides ValueType.Equals(Object).)
Public methodEquals(Color)Determines whether the specified color equals this object.
Public methodStatic memberFromNonPremultipliedConverts a non-premultipled alpha color to a color that contains premultiplied alpha.
Public methodGetHashCodeGets the hash code for this object. (Overrides ValueType.GetHashCode().)
Public methodStatic memberLerpLinearly interpolate a color.
Public methodStatic memberMultiplyMultiply each color component by the scale factor.
Public methodToStringGets a string representation of this object. (Overrides ValueType.ToString().)
Top

  NameDescription
Public operatorStatic memberEqualityDetermines whether the specified colors are equal.
Public operatorStatic memberInequalityDetermines whether the specified colors are not equal.
Public operatorStatic memberMultiplyMultiplies the specified color and a scale factor.
Top

  NameDescription
Public Extension MethodToVector3Converts the specified color into a Vector3. (Defined by ColorExtensions.)
Public Extension MethodToVector4Converts the specified color into a Vector4. (Defined by ColorExtensions.)
Top

Silverlight

Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show: