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
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 { readonly get; set; }
Property Value
B
public byte B { readonly get; set; }
Property Value
Blue
public float Blue { readonly get; set; }
Property Value
G
public byte G { readonly get; set; }
Property Value
Green
public float Green { readonly get; set; }
Property Value
R
public byte R { readonly get; set; }
Property Value
Red
public float Red { readonly get; set; }
Property Value
Methods
DropAlpha()
Removes the alpha channel from the color (setting it to full opacity).
public readonly XColor DropAlpha()
Returns
Equals(XColor)
public bool Equals(XColor other)
Parameters
otherXColor
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override readonly int GetHashCode()
Returns
ToColor4()
public readonly Color4 ToColor4()
Returns
- Color4
ToString()
public override readonly string ToString()
Returns
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
colorXColor
Returns
implicit operator XColor(Color)
public static implicit operator XColor(Color color)
Parameters
colorColor
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)