Struct XMColorRgba
A 32-bit Alpha Red Green Blue (ARGB) color vector, where each color channel is specified as an unsigned 8 bit integer.
Implements
Inherited Members
Namespace: JeremyAnsel.DirectX.DXMath.PackedVector
Assembly: JeremyAnsel.DirectX.DXMath.dll
Syntax
public struct XMColorRgba : IEquatable<XMColorRgba>
Constructors
| Edit this page View SourceXMColorRgba(float, float, float, float)
Initializes a new instance of the XMColorRgba struct.
Declaration
public XMColorRgba(float r, float g, float b, float a)
Parameters
Type | Name | Description |
---|---|---|
float | r | The red component. |
float | g | The green component. |
float | b | The blue component. |
float | a | The alpha component. |
XMColorRgba(float[])
Initializes a new instance of the XMColorRgba struct.
Declaration
public XMColorRgba(float[] values)
Parameters
Type | Name | Description |
---|---|---|
float[] | values | The components of the color. |
XMColorRgba(uint)
Initializes a new instance of the XMColorRgba struct.
Declaration
public XMColorRgba(uint color)
Parameters
Type | Name | Description |
---|---|---|
uint | color | A packed value representing the color. |
Properties
| Edit this page View SourceAlpha
Gets or sets the alpha component.
Declaration
public byte Alpha { get; set; }
Property Value
Type | Description |
---|---|
byte |
Blue
Gets or sets the blue component.
Declaration
public byte Blue { get; set; }
Property Value
Type | Description |
---|---|
byte |
Green
Gets or sets the green component.
Declaration
public byte Green { get; set; }
Property Value
Type | Description |
---|---|
byte |
Red
Gets or sets the red component.
Declaration
public byte Red { get; set; }
Property Value
Type | Description |
---|---|
byte |
Methods
| Edit this page View SourceEquals(XMColorRgba)
Determines whether the specified object is equal to the current object.
Declaration
public bool Equals(XMColorRgba other)
Parameters
Type | Name | Description |
---|---|---|
XMColorRgba | other | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceFromArgb(uint)
Converts a packed value to a XMColorRgba.
Declaration
public static XMColorRgba FromArgb(uint value)
Parameters
Type | Name | Description |
---|---|---|
uint | value | A packed value. |
Returns
Type | Description |
---|---|
XMColorRgba | A XMColorRgba. |
FromVector(XMVector)
Converts a XMVector to a XMColorRgba.
Declaration
public static XMColorRgba FromVector(XMVector value)
Parameters
Type | Name | Description |
---|---|---|
XMVector | value | A XMVector. |
Returns
Type | Description |
---|---|
XMColorRgba | A XMColorRgba. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A 32-bit signed integer that is the hash code for this instance. |
Overrides
| Edit this page View SourceToArgb()
Converts a XMColorRgba to a packed value.
Declaration
public uint ToArgb()
Returns
Type | Description |
---|---|
uint | A packed value. |
ToVector()
Converts a XMColorRgba to a XMVector.
Declaration
public XMVector ToVector()
Returns
Type | Description |
---|---|
XMVector | A XMVector. |
Operators
| Edit this page View Sourceoperator ==(XMColorRgba, XMColorRgba)
Compares two XMColorRgba objects. The result specifies whether the values of the two objects are equal.
Declaration
public static bool operator ==(XMColorRgba left, XMColorRgba right)
Parameters
Type | Name | Description |
---|---|---|
XMColorRgba | left | The left XMColorRgba to compare. |
XMColorRgba | right | The right XMColorRgba to compare. |
Returns
Type | Description |
---|---|
bool |
implicit operator XMVector(XMColorRgba)
Converts a XMColorRgba to a XMVector.
Declaration
public static implicit operator XMVector(XMColorRgba value)
Parameters
Type | Name | Description |
---|---|---|
XMColorRgba | value | A XMColorRgba. |
Returns
Type | Description |
---|---|
XMVector | A XMVector. |
implicit operator uint(XMColorRgba)
Converts a XMColorRgba to a packed value.
Declaration
public static implicit operator uint(XMColorRgba color)
Parameters
Type | Name | Description |
---|---|---|
XMColorRgba | color | A XMColorRgba. |
Returns
Type | Description |
---|---|
uint | A packed value. |
implicit operator XMColorRgba(XMVector)
Converts a XMVector to a XMColorRgba.
Declaration
public static implicit operator XMColorRgba(XMVector value)
Parameters
Type | Name | Description |
---|---|---|
XMVector | value | A XMVector. |
Returns
Type | Description |
---|---|
XMColorRgba | A XMColorRgba. |
implicit operator XMColorRgba(uint)
Converts a packed value to a XMColorRgba.
Declaration
public static implicit operator XMColorRgba(uint color)
Parameters
Type | Name | Description |
---|---|---|
uint | color | A packed value. |
Returns
Type | Description |
---|---|
XMColorRgba | A XMColorRgba. |
operator !=(XMColorRgba, XMColorRgba)
Compares two XMColorRgba objects. The result specifies whether the values of the two objects are unequal.
Declaration
public static bool operator !=(XMColorRgba left, XMColorRgba right)
Parameters
Type | Name | Description |
---|---|---|
XMColorRgba | left | The left XMColorRgba to compare. |
XMColorRgba | right | The right XMColorRgba to compare. |
Returns
Type | Description |
---|---|
bool |