Struct Color
Color that can be rendered by terminals. Wraps a FullColor or BasicColor.
public readonly struct Color
- Inherited Members
Constructors
Color(float, float, float)
Initializes a new instance of the Color struct.
public Color(float r, float g, float b)
Parameters
rfloatThe FullColor red component.
gfloatThe FullColor green component.
bfloatThe FullColor blue component.
Color(BasicColor)
Initializes a new instance of the Color struct.
public Color(BasicColor baseColor)
Parameters
baseColorBasicColorThe base color to wrap.
Color(FullColor)
Initializes a new instance of the Color struct.
public Color(FullColor fullColor)
Parameters
fullColorFullColorThe full color to wrap.
Properties
Basic
Gets the basic preset color if one was set.
public BasicColor Basic { get; }
Property Value
Full
Gets the full RGB color if one was set.
public FullColor? Full { get; }
Property Value
Methods
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current instance.
Returns
- bool
true if
objand 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.
Operators
operator ==(Color, Color)
Determines whether two Color instances are equal.
public static bool operator ==(Color c1, Color c2)
Parameters
Returns
- bool
true if the colors are equal; otherwise, false.
implicit operator Color((float r, float g, float b))
public static implicit operator Color((float r, float g, float b) tuple)
Parameters
Returns
implicit operator Color(BasicColor)
Creates a color from a basic color.
public static implicit operator Color(BasicColor b)
Parameters
bBasicColorThe basic color to use.
Returns
implicit operator Color(FullColor)
public static implicit operator Color(FullColor fullColor)
Parameters
fullColorFullColorThe FullColor to use.
Returns
operator !=(Color, Color)
Determines whether two Color instances are not equal.
public static bool operator !=(Color c1, Color c2)
Parameters
Returns
- bool
true if the colors are not equal; otherwise, false.