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(ReadOnlySpan<float>)
Initializes a new instance of the XMColorRgba struct.
Declaration
public XMColorRgba(ReadOnlySpan<float> values)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<float> | values | The components of the color. |
XMColorRgba(float, float, float, float)
Initializes a new instance of the XMColorRgba struct.
Declaration
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "r", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "g", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "b", Justification = "Reviewed")]
[SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "a", Justification = "Reviewed")]
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)
Declaration
public readonly bool Equals(XMColorRgba other)
Parameters
| Type | Name | Description |
|---|---|---|
| XMColorRgba | other |
Returns
| Type | Description |
|---|---|
| bool |
Equals(object?)
Declaration
public override readonly bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj |
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()
Declaration
public override readonly int GetHashCode()
Returns
| Type | Description |
|---|---|
| int |
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)
Declaration
public static bool operator ==(XMColorRgba left, XMColorRgba right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMColorRgba | left | |
| XMColorRgba | right |
Returns
| Type | Description |
|---|---|
| bool |
implicit operator XMVector(XMColorRgba)
Converts a XMColorRgba to a XMVector.
Declaration
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
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
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
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
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
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
[SuppressMessage("Usage", "CA2225:Les surcharges d'opérateur offrent d'autres méthodes nommées", Justification = "Reviewed.")]
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)
Declaration
public static bool operator !=(XMColorRgba left, XMColorRgba right)
Parameters
| Type | Name | Description |
|---|---|---|
| XMColorRgba | left | |
| XMColorRgba | right |
Returns
| Type | Description |
|---|---|
| bool |