Struct XColor
- Namespace
- OmegaEngine.Foundation.Light
- Assembly
- OmegaEngine.Foundation.dll
Stores ARGB-colors as byte values but also surfaces them as float values.
public struct XColor : IEquatable<XColor>
- Implements
- Inherited Members
- Extension Methods
Remarks
This class can be used to serialize ARGB-color values (unlike Color all fields are writable). It provides implicit casts to and from Color.
Constructors
XColor(byte, byte, byte, byte)
Stores ARGB-colors as byte values but also surfaces them as float values.
public XColor(byte a, byte r, byte g, byte b)
Parameters
Remarks
This class can be used to serialize ARGB-color values (unlike Color all fields are writable). It provides implicit casts to and from Color.
XColor(float, float, float, float)
public XColor(float red, float green, float blue, float alpha)
Parameters
Properties
A
public byte A { readonly get; set; }
Property Value
Alpha
public float Alpha { get; set; }
Property Value
B
public byte B { readonly get; set; }
Property Value
Blue
public float Blue { get; set; }
Property Value
G
public byte G { readonly get; set; }
Property Value
Green
public float Green { get; set; }
Property Value
R
public byte R { readonly get; set; }
Property Value
Red
public float Red { get; set; }
Property Value
Methods
DropAlpha()
Removes the alpha channel from the color (setting it to full opacity).
[Pure]
public XColor DropAlpha()
Returns
Equals(XColor)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(XColor other)
Parameters
other
XColorAn object to compare with this object.
Returns
Equals(object?)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current instance.
Returns
- bool
true if
obj
and this instance are the same type and represent the same value; otherwise, false.
GetHashCode()
Returns the hash code for this instance.
public override int GetHashCode()
Returns
- int
A 32-bit signed integer that is the hash code for this instance.
ToColor4()
[Pure]
public Color4 ToColor4()
Returns
- Color4
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
Operators
operator ==(XColor, XColor)
public static bool operator ==(XColor color1, XColor color2)
Parameters
Returns
operator ==(XColor, Color)
public static bool operator ==(XColor color1, Color color2)
Parameters
Returns
operator ==(Color, XColor)
public static bool operator ==(Color color1, XColor color2)
Parameters
Returns
implicit operator Color(XColor)
public static implicit operator Color(XColor color)
Parameters
color
XColor
Returns
implicit operator XColor(Color)
public static implicit operator XColor(Color color)
Parameters
color
Color
Returns
operator !=(XColor, XColor)
public static bool operator !=(XColor color1, XColor color2)
Parameters
Returns
operator !=(XColor, Color)
public static bool operator !=(XColor color1, Color color2)
Parameters
Returns
operator !=(Color, XColor)
public static bool operator !=(Color color1, XColor color2)