Rgba
Namespace: Shadop.Archmage.Sdk
Represents a color with red, green, blue, and alpha channels.
public struct RgbaInheritance Object → ValueType → Rgba
Implements IEquatable
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.
Properties
Section titled “Properties”public byte R { get; }Property Value
Section titled “Property Value”public byte G { get; }Property Value
Section titled “Property Value”public byte B { get; }Property Value
Section titled “Property Value”public byte A { get; }Property Value
Section titled “Property Value”IsZero
Section titled “IsZero”Returns true if all channels are zero.
public bool IsZero { get; }Property Value
Section titled “Property Value”Constructors
Section titled “Constructors”Rgba(Byte, Byte, Byte, Byte)
Section titled “Rgba(Byte, Byte, Byte, Byte)”Rgba(byte r, byte g, byte b, byte a)Parameters
Section titled “Parameters”r Byte
g Byte
b Byte
a Byte
Methods
Section titled “Methods”Parse(String)
Section titled “Parse(String)”Parses a "#RRGGBB" or "#RRGGBBAA" hex string.
An empty or null string returns the zero value.
Rgba Parse(string s)Parameters
Section titled “Parameters”s String
Returns
Section titled “Returns”Exceptions
Section titled “Exceptions”FormatException
Thrown when the string format is invalid.
TryParse(String, Rgba&)
Section titled “TryParse(String, Rgba&)”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)Parameters
Section titled “Parameters”s String
result Rgba&
Returns
Section titled “Returns”ToString()
Section titled “ToString()”Returns the color as "#RRGGBB" when alpha is 0xFF, otherwise "#RRGGBBAA".
string ToString()Returns
Section titled “Returns”Equals(Rgba)
Section titled “Equals(Rgba)”bool Equals(Rgba other)Parameters
Section titled “Parameters”other Rgba
Returns
Section titled “Returns”Equals(Object)
Section titled “Equals(Object)”bool Equals(object obj)Parameters
Section titled “Parameters”obj Object
Returns
Section titled “Returns”GetHashCode()
Section titled “GetHashCode()”int GetHashCode()