Struct HSVA
A colour in HSV (Hue, Saturation, Value) form with an alpha component.
public readonly struct HSVA : IEquatable<HSVA>
- Implements
- Inherited Members
- Extension Methods
Constructors
HSVA(float, float, float, float)
Creates an HSV with the given components without clamping or wrapping.
public HSVA(float hue, float saturation, float value, float alpha)
Parameters
Properties
a
Alpha.
public float a { get; init; }
Property Value
Remarks
This is intended to be in the inclusive range [0, 1]
, but can be outside.
h
Hue.
public float h { get; init; }
Property Value
Remarks
This is intended to be in the inclusive-exclusive range [0, 1)
, but can be outside.
s
Saturation.
public float s { get; init; }
Property Value
Remarks
This is intended to be in the inclusive range [0, 1]
, but can be outside.
v
Value.
public float v { get; init; }
Property Value
Remarks
This is intended to be in the inclusive range [0, 1]
, but can be outside.
Methods
Equals(HSVA)
public bool Equals(HSVA other)
Parameters
other
HSVA
Returns
Equals(HSVA, float)
Returns whether each component of other
differs from the corresponding component of this by <= tolerance
.
public bool Equals(HSVA other, float tolerance)
Parameters
Returns
Equals(object)
See Equals(HSVA).
public override bool Equals(object obj)
Parameters
obj
object
Returns
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.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.
ToString(string)
Applies format
to each component.
public string ToString(string format)
Parameters
format
string
Returns
Operators
operator ==(HSVA, HSVA)
Component-wise equality.
public static bool operator ==(HSVA x, HSVA y)
Parameters
Returns
explicit operator HSVA(Color)
Converts from Color to HSVA.
public static explicit operator HSVA(Color rgba)
Parameters
rgba
Color
Returns
Remarks
Does not do any clamping.
This is independent of colour space.
explicit operator Color(HSVA)
Converts from HSVA to Color.
public static explicit operator Color(HSVA hsva)
Parameters
hsva
HSVA
Returns
- Color
Remarks
Does not do any clamping.
This is independent of colour space.
explicit operator HSLA(HSVA)
public static explicit operator HSLA(HSVA hsva)
Parameters
hsva
HSVA
Returns
Remarks
Does not do any clamping.
This is independent of colour space.
explicit operator HSV(HSVA)
public static explicit operator HSV(HSVA hsva)
Parameters
hsva
HSVA
Returns
operator !=(HSVA, HSVA)
public static bool operator !=(HSVA x, HSVA y)