docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Struct ColorHsva

    A struct representing the hue, saturation, value, and alpha components of a particular color

    Inherited Members
    ValueType.Equals(object)
    ValueType.GetHashCode()
    object.Equals(object, object)
    object.GetType()
    object.ReferenceEquals(object, object)
    Namespace: UnityEngine.Perception.Randomization.Parameters
    Assembly: Unity.Perception.Runtime.dll
    Syntax
    [Serializable]
    public struct ColorHsva

    Constructors

    ColorHsva(float, float, float, float)

    Constructs an ColorHsva struct

    Declaration
    public ColorHsva(float h, float s, float v, float a)
    Parameters
    Type Name Description
    float h

    Hue

    float s

    Saturation

    float v

    Value

    float a

    Alpha

    Fields

    a

    A float value representing the alpha component of a color

    Declaration
    public float a
    Field Value
    Type Description
    float

    h

    A float value representing the hue component of a color

    Declaration
    public float h
    Field Value
    Type Description
    float

    s

    A float value representing the saturation component of a color

    Declaration
    public float s
    Field Value
    Type Description
    float

    v

    A float value representing the value component of a color

    Declaration
    public float v
    Field Value
    Type Description
    float

    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
    ValueType.ToString()

    Operators

    explicit operator ColorHsva(Color)

    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 operator Color(ColorHsva)

    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 operator ColorHsva(float4)

    Implicitly converts an float4 to an HSVA color

    Declaration
    public static implicit operator ColorHsva(float4 f)
    Parameters
    Type Name Description
    float4 f

    The float4 to convert to an HSVA color

    Returns
    Type Description
    ColorHsva

    A new HSVA color

    implicit operator float4(ColorHsva)

    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
    float4

    A new float4

    implicit operator Vector4(ColorHsva)

    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 operator ColorHsva(Vector4)

    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

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)