Struct ColorHsva
A struct representing the hue, saturation, value, and alpha components of a particular color
Inherited Members
Namespace: UnityEngine.Experimental.Perception.Randomization.Parameters
Syntax
[Serializable]
public struct ColorHsva
Constructors
ColorHsva(Single, Single, Single, Single)
Constructs an ColorHsva struct
Declaration
public ColorHsva(float h, float s, float v, float a)
Parameters
Type | Name | Description |
---|---|---|
Single | h | Hue |
Single | s | Saturation |
Single | v | Value |
Single | a | Alpha |
Fields
a
A float value representing the alpha component of a color
Declaration
public float a
Field Value
Type | Description |
---|---|
Single |
h
A float value representing the hue component of a color
Declaration
public float h
Field Value
Type | Description |
---|---|
Single |
s
A float value representing the saturation component of a color
Declaration
public float s
Field Value
Type | Description |
---|---|
Single |
v
A float value representing the value component of a color
Declaration
public float v
Field Value
Type | Description |
---|---|
Single |
Methods
ToString()
Generates a string representation of a ColorHsva
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representing the components of this ColorHsva |
Overrides
Operators
Explicit(Color to ColorHsva)
Converts an RGBA Color to an HSVA Color
Declaration
public static explicit operator ColorHsva(Color c)
Parameters
Type | Name | Description |
---|---|---|
Color | c | The RGBA color to convert to HSVA |
Returns
Type | Description |
---|---|
ColorHsva | A new HSVA color |
Explicit(ColorHsva to Color)
Converts an HSVA Color to an RGBA Color
Declaration
public static explicit operator Color(ColorHsva c)
Parameters
Type | Name | Description |
---|---|---|
ColorHsva | c | The HSVA color to convert to RGBA |
Returns
Type | Description |
---|---|
Color | A new RGBA color |
Implicit(float4 to ColorHsva)
Implicitly converts an float4 to an HSVA color
Declaration
public static implicit operator ColorHsva(float4 f)
Parameters
Type | Name | Description |
---|---|---|
Unity.Mathematics.float4 | f | The float4 to convert to an HSVA color |
Returns
Type | Description |
---|---|
ColorHsva | A new HSVA color |
Implicit(ColorHsva to float4)
Implicitly converts an HSVA Color to a float4
Declaration
public static implicit operator float4(ColorHsva c)
Parameters
Type | Name | Description |
---|---|---|
ColorHsva | c | The HSVA color to convert to a float4 |
Returns
Type | Description |
---|---|
Unity.Mathematics.float4 | A new float4 |
Implicit(ColorHsva to Vector4)
Implicitly converts an HSVA Color to a Vector4
Declaration
public static implicit operator Vector4(ColorHsva c)
Parameters
Type | Name | Description |
---|---|---|
ColorHsva | c | The HSVA color to convert to a Vector4 |
Returns
Type | Description |
---|---|
Vector4 | A new Vector4 |
Implicit(Vector4 to ColorHsva)
Implicitly converts an Vector4 to an HSVA color
Declaration
public static implicit operator ColorHsva(Vector4 v)
Parameters
Type | Name | Description |
---|---|---|
Vector4 | v | The Vector4 color to convert to an HSVA color |
Returns
Type | Description |
---|---|
ColorHsva | A new HSVA color |