Table of Contents

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

h float

The h.

s float

The s.

v float

The v.

a float

A.

Fields

A

The alpha component of the color.

[DataMember(3)]
public float A

Field Value

float

H

The Hue of the color.

[DataMember(0)]
public float H

Field Value

float

S

The Saturation of the color.

[DataMember(1)]
public float S

Field Value

float

V

The Value of the color.

[DataMember(2)]
public float V

Field Value

float

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

h float

The H component

s float

The S component

v float

The V component

a float

The A component

Equals(ColorHSV)

Indicates whether the current object is equal to another object of the same type.

public bool Equals(ColorHSV other)

Parameters

other ColorHSV

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object)

Indicates whether this instance and a specified object are equal.

public override bool Equals(object obj)

Parameters

obj object

The 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 Color4

The 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

string

A string that represents this instance.

ToString(IFormatProvider)

Returns a string that represents this instance.

public string ToString(IFormatProvider formatProvider)

Parameters

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.

ToString(string)

Returns a string that represents this instance.

public string ToString(string format)

Parameters

format string

The format.

Returns

string

A string that represents this instance.

ToString(string, IFormatProvider)

Returns a string that represents this instance.

public string ToString(string format, IFormatProvider formatProvider)

Parameters

format string

The format.

formatProvider IFormatProvider

The format provider.

Returns

string

A string that represents this instance.