Struct RgbaFloat
A color stored in four 32-bit floating-point values, in RGBA component order.
Implements
Inherited Members
Namespace: Veldrid
Assembly: cs.temp.dll.dll
Syntax
public struct RgbaFloat : IEquatable<RgbaFloat>
Constructors
RgbaFloat(Single, Single, Single, Single)
Constructs a new RgbaFloat from the given components.
Declaration
public RgbaFloat(float r, float g, float b, float a)
Parameters
Type | Name | Description |
---|---|---|
System.Single | r | The red component. |
System.Single | g | The green component. |
System.Single | b | The blue component. |
System.Single | a | The alpha component. |
RgbaFloat(Vector4)
Constructs a new RgbaFloat from the XYZW components of a vector.
Declaration
public RgbaFloat(Vector4 channels)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | channels | The vector containing the color components. |
Fields
Black
Black (0, 0, 0, 1)
Declaration
public static readonly RgbaFloat Black
Field Value
Type | Description |
---|---|
RgbaFloat |
Blue
Blue (0, 0, 1, 1)
Declaration
public static readonly RgbaFloat Blue
Field Value
Type | Description |
---|---|
RgbaFloat |
Clear
Clear (0, 0, 0, 0)
Declaration
public static readonly RgbaFloat Clear
Field Value
Type | Description |
---|---|
RgbaFloat |
CornflowerBlue
Cornflower Blue (0.3921f, 0.5843f, 0.9294f, 1)
Declaration
public static readonly RgbaFloat CornflowerBlue
Field Value
Type | Description |
---|---|
RgbaFloat |
Cyan
Cyan (0, 1, 1, 1)
Declaration
public static readonly RgbaFloat Cyan
Field Value
Type | Description |
---|---|
RgbaFloat |
DarkRed
Dark Red (0.6f, 0, 0, 1)
Declaration
public static readonly RgbaFloat DarkRed
Field Value
Type | Description |
---|---|
RgbaFloat |
Green
Green (0, 1, 0, 1)
Declaration
public static readonly RgbaFloat Green
Field Value
Type | Description |
---|---|
RgbaFloat |
Grey
Grey (0.25f, 0.25f, 0.25f, 1)
Declaration
public static readonly RgbaFloat Grey
Field Value
Type | Description |
---|---|
RgbaFloat |
LightGrey
Light Grey (0.65f, 0.65f, 0.65f, 1)
Declaration
public static readonly RgbaFloat LightGrey
Field Value
Type | Description |
---|---|
RgbaFloat |
Orange
Orange (1, 0.36f, 0, 1)
Declaration
public static readonly RgbaFloat Orange
Field Value
Type | Description |
---|---|
RgbaFloat |
Pink
Pink (1, 0.45f, 0.75f, 1)
Declaration
public static readonly RgbaFloat Pink
Field Value
Type | Description |
---|---|
RgbaFloat |
Red
Red (1, 0, 0, 1)
Declaration
public static readonly RgbaFloat Red
Field Value
Type | Description |
---|---|
RgbaFloat |
SizeInBytes
The total size, in bytes, of an RgbaFloat value.
Declaration
public static readonly int SizeInBytes
Field Value
Type | Description |
---|---|
System.Int32 |
White
White (1, 1, 1, 1)
Declaration
public static readonly RgbaFloat White
Field Value
Type | Description |
---|---|
RgbaFloat |
Yellow
Yellow (1, 1, 0, 1)
Declaration
public static readonly RgbaFloat Yellow
Field Value
Type | Description |
---|---|
RgbaFloat |
Properties
A
The alpha component.
Declaration
public float A { get; }
Property Value
Type | Description |
---|---|
System.Single |
B
The blue component.
Declaration
public float B { get; }
Property Value
Type | Description |
---|---|
System.Single |
G
The green component.
Declaration
public float G { get; }
Property Value
Type | Description |
---|---|
System.Single |
R
The red component.
Declaration
public float R { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
Equals(Object)
Determines whether the specified object is equal to the current object.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object is equal to the current object; otherwise, false. |
Overrides
Equals(RgbaFloat)
Element-wise equality.
Declaration
public bool Equals(RgbaFloat other)
Parameters
Type | Name | Description |
---|---|---|
RgbaFloat | other | The instance to compare to. |
Returns
Type | Description |
---|---|
System.Boolean | True if all elements are equal; false otherswise. |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer that is the hash code for this instance. |
Overrides
ToString()
Returns a string representation of this color.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
System.String |
Overrides
ToVector4()
Converts this RgbaFloat into a Vector4.
Declaration
public Vector4 ToVector4()
Returns
Type | Description |
---|---|
Vector4 |
Operators
Equality(RgbaFloat, RgbaFloat)
Element-wise equality.
Declaration
public static bool operator ==(RgbaFloat left, RgbaFloat right)
Parameters
Type | Name | Description |
---|---|---|
RgbaFloat | left | The first value. |
RgbaFloat | right | The second value. |
Returns
Type | Description |
---|---|
System.Boolean |
Inequality(RgbaFloat, RgbaFloat)
Element-wise inequality.
Declaration
public static bool operator !=(RgbaFloat left, RgbaFloat right)
Parameters
Type | Name | Description |
---|---|---|
RgbaFloat | left | The first value. |
RgbaFloat | right | The second value. |
Returns
Type | Description |
---|---|
System.Boolean |