Skip to content

Rgba

Namespace: Shadop.Archmage.Sdk

Represents a color with red, green, blue, and alpha channels.

public struct Rgba

Inheritance ObjectValueTypeRgba
Implements IEquatable, IZero

Remarks:

Serializes to JSON as "#RRGGBBAA". Deserializes from "#RRGGBB", "#RRGGBBAA", an empty string, or null. The zero value (all channels 0) serializes as an empty string.

public byte R { get; }

Byte

public byte G { get; }

Byte

public byte B { get; }

Byte

public byte A { get; }

Byte

Returns true if all channels are zero.

public bool IsZero { get; }

Boolean

Rgba(byte r, byte g, byte b, byte a)

r Byte

g Byte

b Byte

a Byte

Parses a "#RRGGBB" or "#RRGGBBAA" hex string. An empty or null string returns the zero value.

Rgba Parse(string s)

s String

Rgba

FormatException
Thrown when the string format is invalid.

Tries to parse a "#RRGGBB" or "#RRGGBBAA" hex string. An empty or null string sets result to the zero value and returns true.

bool TryParse(string s, Rgba& result)

s String

result Rgba&

Boolean

Returns the color as "#RRGGBB" when alpha is 0xFF, otherwise "#RRGGBBAA".

string ToString()

String

bool Equals(Rgba other)

other Rgba

Boolean

bool Equals(object obj)

obj Object

Boolean

int GetHashCode()

Int32