ColorHSV Struct
Namespace: Stride.Core.MathematicsAssembly: Stride.Core.Mathematics.dll
Represents a color in the form of Hue, Saturation, Value, Alpha.
[DataContract("ColorHSV")]
public struct ColorHSV : IEquatable<ColorHSV>, IFormattable
Name | Description | |
---|---|---|
Constructors | ||
ColorHSV(Single, Single, Single, Single) | Initializes a new instance of the ColorHSV struct. |
|
Fields | ||
A | The alpha component of the color. |
|
H | The Hue of the color. |
|
S | The Saturation of the color. |
|
V | The Value of the color. |
|
Methods | ||
Equals(ColorHSV) | ||
Equals(Object) | ||
FromColor(Color4) | Converts the color into a HSV color. |
|
GetHashCode() | ||
ToColor() | Converts the color into a three component vector. |
|
ToString() | Returns a System.String that represents this instance. |
|
ToString(IFormatProvider) | Returns a System.String that represents this instance. |
|
ToString(String) | Returns a System.String that represents this instance. |
|
ToString(String, IFormatProvider) | Returns a System.String that represents this instance. |
Constructors
ColorHSV(Single, Single, Single, Single)
Initializes a new instance of the ColorHSV struct.
public ColorHSV(float h, float s, float v, float a)
Parameters
Type | Name | Description |
---|---|---|
System.Single | h | The h. |
System.Single | s | The s. |
System.Single | v | The v. |
System.Single | a | A. |
Fields
A
The alpha component of the color.
[DataMember(3)]
public float A
Field Value
Type | Description |
---|---|
System.Single |
H
The Hue of the color.
[DataMember(0)]
public float H
Field Value
Type | Description |
---|---|
System.Single |
S
The Saturation of the color.
[DataMember(1)]
public float S
Field Value
Type | Description |
---|---|
System.Single |
V
The Value of the color.
[DataMember(2)]
public float V
Field Value
Type | Description |
---|---|
System.Single |
Methods
Equals(ColorHSV)
public bool Equals(ColorHSV other)
Parameters
Type | Name | Description |
---|---|---|
ColorHSV | other |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj |
Returns
Type | Description |
---|---|
System.Boolean |
Overrides
FromColor(Color4)
Converts the color into a HSV color.
public static ColorHSV FromColor(Color4 color)
Parameters
Type | Name | Description |
---|---|---|
Color4 | color | The color. |
Returns
Type | Description |
---|---|
ColorHSV | A HSV color |
GetHashCode()
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
ToColor()
Converts the color into a three component vector.
public Color4 ToColor()
Returns
Type | Description |
---|---|
Color4 | A three component vector containing the red, green, and blue components of the color. |
ToString()
Returns a System.String that represents this instance.
public override string ToString()
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
Overrides
ToString(IFormatProvider)
Returns a System.String that represents this instance.
public string ToString(IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
ToString(String)
Returns a System.String that represents this instance.
public string ToString(string format)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | The format. |
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |
ToString(String, IFormatProvider)
Returns a System.String that represents this instance.
public string ToString(string format, IFormatProvider formatProvider)
Parameters
Type | Name | Description |
---|---|---|
System.String | format | The format. |
System.IFormatProvider | formatProvider | The format provider. |
Returns
Type | Description |
---|---|
System.String | A System.String that represents this instance. |