Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    ColorHSV Struct

    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
    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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
    System.ValueType.Equals(System.Object)

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

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

    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.


    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    • Improve this Doc
    • View Source
    In This Article
    In This Article
    • Constructors
      • ColorHSV(Single, Single, Single, Single)
    • Fields
      • A
      • H
      • S
      • V
    • Methods
      • Equals(ColorHSV)
      • Equals(Object)
      • FromColor(Color4)
      • GetHashCode()
      • ToColor()
      • ToString()
      • ToString(IFormatProvider)
      • ToString(String)
      • ToString(String, IFormatProvider)
    • Extension Methods

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation