Hsv Struct
A color given by its hue, saturation and value (HSV, also called HSB), a cylindrical form of the encoded RGB values of a device.
public readonly struct Hsv : IEquatable<Hsv>Remarks
HSV describes RGB values, not colors: it has no color space of its own, and its conversions read and write the stored RGB values as they are, whatever their color space. The value is the largest RGB value and the saturation is the range of the RGB values relative to it. The conversions from RGB give the hue in [0, 360); a gray has no hue: it is 0.
The values are not validated: the conversion to RGB clips each component to [0, 1].
- Implements
Constructors
| Name | Description |
|---|---|
| Hsv(double, double, double) | Initializes a new instance of the Hsv struct. |
Hsv(double, double, double)
Hsv.csInitializes a new instance of the Hsv struct.
Properties
| Name | Description |
|---|---|
| H | Gets the hue angle, in degrees: 0 is red, 120 green, 240 blue. |
| S | Gets the saturation, from 0 (gray) to 1 (the pure hue). |
| V | Gets the value, the largest of the red, green and blue values, from 0 (black) to 1. |
Methods
| Name | Description |
|---|---|
| Equals(Hsv) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| FromRgb(Rgba32) | Converts an 8-bit RGB color to HSV. Alpha is ignored. |
| FromRgb(Rgba64) | Converts a 16-bit RGB color to HSV. Alpha is ignored. |
| GetHashCode() | Returns the hash code for this instance. |
| ToRgba32() | Converts this color to an opaque 8-bit RGB color, each component clipped to [0, 1]. |
| ToRgba64() | Converts this color to an opaque 16-bit RGB color, each component clipped to [0, 1]. |
| ToString() | Returns the fully qualified type name of this instance. |
GetHashCode()
Hsv.csToRgba32()
Hsv.csToRgba64()
Hsv.csToString()
Hsv.csOperators
| Name | Description |
|---|---|
| operator ==(Hsv, Hsv) | Compares two colors for equality, component by component. |
| operator !=(Hsv, Hsv) | Compares two colors for inequality, component by component. |