Skip to content

Class Hsv

Definition

Namespace: StardewUI.Graphics
Assembly: StardewUI.dll

A color in the HSV space.

public record Hsv : IEquatable<StardewUI.Graphics.Hsv>

Inheritance
Object ⇦ Hsv

Implements
IEquatable<Hsv>

Members

Constructors

Name Description
Hsv(Int32, Single, Single) A color in the HSV space.

Properties

Name Description
EqualityContract
Hue The color hue.
Saturation The color saturation.
Value The color value or brightness.

Methods

Name Description
FromRgb(Color) Converts an RGB color to its HSV equivalent.
ToRgb(Single) Converts this color to its RGB equivalent.

Details

Constructors

Hsv(int, float, float)

A color in the HSV space.

public Hsv(int Hue, float Saturation, float Value);
Parameters

Hue   Int32
The color hue.

Saturation   Single
The color saturation.

Value   Single
The color value or brightness.


Properties

EqualityContract

protected System.Type EqualityContract { get; }
Property Value

Type


Hue

The color hue.

public int Hue { get; set; }
Property Value

Int32


Saturation

The color saturation.

public float Saturation { get; set; }
Property Value

Single


Value

The color value or brightness.

public float Value { get; set; }
Property Value

Single


Methods

FromRgb(Color)

Converts an RGB color to its HSV equivalent.

public static StardewUI.Graphics.Hsv FromRgb(Microsoft.Xna.Framework.Color color);
Parameters

color   Color
The RGB color.

Returns

Hsv

The color converted to HSV components.


ToRgb(float)

Converts this color to its RGB equivalent.

public Microsoft.Xna.Framework.Color ToRgb(float alpha);
Parameters

alpha   Single
Optional alpha component if not 1 (fully opaque).

Returns

Color

The RGB color.