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
- Inherited Members
- Extension Methods
Remarks
This class can be used to serialize ARGB-color values (unlike Color all fields are writable). It provides easy methods for casting to and from Color (useful in combination with a PropertyGrid). It also provides easy methods for casting to and from SlimDX.Color4 (useful for rendering with SlimDX).
Constructors
XColor(byte, byte, byte, byte)
public XColor(byte a, byte r, byte g, byte b)
Parameters
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
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.
FromColorValue(Color4)
[Pure]
public static XColor FromColorValue(Color4 color)
Parameters
color
Color4
Returns
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.
ToColorValue()
[Pure]
public Color4 ToColorValue()
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
explicit operator Color(XColor)
public static explicit 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)