|
|
@ -19,6 +19,16 @@ namespace ImageSharp.Colors.Spaces |
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
public static readonly Hsv Empty = default(Hsv); |
|
|
public static readonly Hsv Empty = default(Hsv); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Min range used for clamping
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private static readonly Vector3 VectorMin = Vector3.Zero; |
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Max range used for clamping
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private static readonly Vector3 VectorMax = new Vector3(360, 1, 1); |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
/// The backing vector for SIMD support.
|
|
|
/// The backing vector for SIMD support.
|
|
|
/// </summary>
|
|
|
/// </summary>
|
|
|
@ -32,7 +42,7 @@ namespace ImageSharp.Colors.Spaces |
|
|
/// <param name="v">The v value (brightness) component.</param>
|
|
|
/// <param name="v">The v value (brightness) component.</param>
|
|
|
public Hsv(float h, float s, float v) |
|
|
public Hsv(float h, float s, float v) |
|
|
{ |
|
|
{ |
|
|
this.backingVector = Vector3.Clamp(new Vector3(h, s, v), Vector3.Zero, new Vector3(360, 1, 1)); |
|
|
this.backingVector = Vector3.Clamp(new Vector3(h, s, v), VectorMin, VectorMax); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
/// <summary>
|
|
|
|