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 : 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

a byte
r byte
g byte
b byte

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

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

DropAlpha()

Removes the alpha channel from the color (setting it to full opacity).

[Pure]
public XColor DropAlpha()

Returns

XColor

Equals(XColor)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(XColor other)

Parameters

other XColor

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

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.

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

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

implicit operator Color(XColor)

public static implicit 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