Table of Contents

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

a byte
r byte
g byte
b byte

XColor(float, float, float, float)

public XColor(float red, float green, float blue, float alpha)

Parameters

red float
green float
blue float
alpha float

Properties

A

public byte A { readonly get; set; }

Property Value

byte

Alpha

public float Alpha { get; set; }

Property Value

float

B

public byte B { readonly get; set; }

Property Value

byte

Blue

public float Blue { get; set; }

Property Value

float

G

public byte G { readonly get; set; }

Property Value

byte

Green

public float Green { get; set; }

Property Value

float

R

public byte R { readonly get; set; }

Property Value

byte

Red

public float Red { get; set; }

Property Value

float

Methods

Equals(object?)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)

Parameters

obj object

The 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

XColor

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

color1 XColor
color2 XColor

Returns

bool

operator ==(XColor, Color)

public static bool operator ==(XColor color1, Color color2)

Parameters

color1 XColor
color2 Color

Returns

bool

operator ==(Color, XColor)

public static bool operator ==(Color color1, XColor color2)

Parameters

color1 Color
color2 XColor

Returns

bool

explicit operator Color(XColor)

public static explicit operator Color(XColor color)

Parameters

color XColor

Returns

Color

implicit operator XColor(Color)

public static implicit operator XColor(Color color)

Parameters

color Color

Returns

XColor

operator !=(XColor, XColor)

public static bool operator !=(XColor color1, XColor color2)

Parameters

color1 XColor
color2 XColor

Returns

bool

operator !=(XColor, Color)

public static bool operator !=(XColor color1, Color color2)

Parameters

color1 XColor
color2 Color

Returns

bool

operator !=(Color, XColor)

public static bool operator !=(Color color1, XColor color2)

Parameters

color1 Color
color2 XColor

Returns

bool