Struct ColorHSV
- Namespace
- Stride.Core.Mathematics
- Assembly
- Stride.Core.Mathematics.dll
Represents a color in the form of Hue, Saturation, Value, Alpha.
[DataContract("ColorHSV")]
public struct ColorHSV : IEquatable<ColorHSV>, IFormattable
- Implements
Constructors
ColorHSV(float, float, float, float)
Initializes a new instance of the ColorHSV struct.
public ColorHSV(float h, float s, float v, float a)
Parameters
Fields
A
The alpha component of the color.
[DataMember(3)]
public float A
Field Value
H
The Hue of the color.
[DataMember(0)]
public float H
Field Value
S
The Saturation of the color.
[DataMember(1)]
public float S
Field Value
V
The Value of the color.
[DataMember(2)]
public float V
Field Value
Methods
Deconstruct(out float, out float, out float, out float)
Deconstructs the vector's components into named variables.
public void Deconstruct(out float h, out float s, out float v, out float a)
Parameters
Equals(ColorHSV)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(ColorHSV other)
Parameters
other
ColorHSVAn object to compare with this object.
Returns
Equals(object)
Indicates whether this instance and a specified object are equal.
public override bool Equals(object obj)
Parameters
obj
objectThe 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.
FromColor(Color4)
Converts the color into a HSV color.
public static ColorHSV FromColor(Color4 color)
Parameters
color
Color4The color.
Returns
- ColorHSV
A HSV color
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.
ToColor()
Converts the color into a three component vector.
public Color4 ToColor()
Returns
- Color4
A three component vector containing the red, green, and blue components of the color.
ToString()
Returns a string that represents this instance.
public override string ToString()
Returns
ToString(IFormatProvider)
Returns a string that represents this instance.
public string ToString(IFormatProvider formatProvider)
Parameters
formatProvider
IFormatProviderThe format provider.
Returns
ToString(string)
Returns a string that represents this instance.
public string ToString(string format)
Parameters
format
stringThe format.
Returns
ToString(string, IFormatProvider)
Returns a string that represents this instance.
public string ToString(string format, IFormatProvider formatProvider)
Parameters
format
stringThe format.
formatProvider
IFormatProviderThe format provider.