Table of Contents

Struct Hsv

Namespace
SixLabors.ImageSharp.ColorProfiles
Assembly
SixLabors.ImageSharp.dll

Represents a HSV (hue, saturation, value) color. Also known as HSB (hue, saturation, brightness).

public readonly struct Hsv : IColorProfile<Hsv, Rgb>, IColorProfile<Hsv>, IColorProfile, IEquatable<Hsv>
Implements
Inherited Members

Constructors

Hsv(Vector3)

Initializes a new instance of the Hsv struct.

public Hsv(Vector3 vector)

Parameters

vector Vector3

The vector representing the h, s, v components.

Hsv(float, float, float)

Initializes a new instance of the Hsv struct.

public Hsv(float h, float s, float v)

Parameters

h float

The h hue component.

s float

The s saturation component.

v float

The v value (brightness) component.

Properties

H

Gets the hue component. A value ranging between 0 and 360.

public float H { get; }

Property Value

float

S

Gets the saturation component. A value ranging between 0 and 1.

public float S { get; }

Property Value

float

V

Gets the value (brightness) component. A value ranging between 0 and 1.

public float V { get; }

Property Value

float

Methods

Equals(Hsv)

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

public bool Equals(Hsv other)

Parameters

other Hsv

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.

FromProfileConnectingSpace(ColorConversionOptions, in Rgb)

Initializes the color instance from the profile connection space.

public static Hsv FromProfileConnectingSpace(ColorConversionOptions options, in Rgb source)

Parameters

options ColorConversionOptions

The color profile conversion options.

source Rgb

The color profile connecting space.

Returns

Hsv

The Hsv.

FromProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<Rgb>, Span<Hsv>)

Converts the span of colors from the profile connection space.

public static void FromProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<Rgb> source, Span<Hsv> destination)

Parameters

options ColorConversionOptions

The color profile conversion options.

source ReadOnlySpan<Rgb>

The color profile span to convert from.

destination Span<Hsv>

The color span to write the results to.

FromScaledVector4(Vector4)

Initializes the color instance from a generic a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1.

public static Hsv FromScaledVector4(Vector4 source)

Parameters

source Vector4

The vector to load the pixel from.

Returns

Hsv

The Hsv.

FromScaledVector4(ReadOnlySpan<Vector4>, Span<Hsv>)

Converts the span of colors from a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1.

public static void FromScaledVector4(ReadOnlySpan<Vector4> source, Span<Hsv> destination)

Parameters

source ReadOnlySpan<Vector4>

The vector span to convert from.

destination Span<Hsv>

The color span to write the results to.

GetChromaticAdaptionWhitePointSource()

Gets the chromatic adaption white point source.

public static ChromaticAdaptionWhitePointSource GetChromaticAdaptionWhitePointSource()

Returns

ChromaticAdaptionWhitePointSource

The ChromaticAdaptionWhitePointSource.

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.

ToProfileConnectingSpace(ColorConversionOptions)

Converts the color to the profile connection space.

public Rgb ToProfileConnectingSpace(ColorConversionOptions options)

Parameters

options ColorConversionOptions

The color profile conversion options.

Returns

Rgb

The Rgb.

ToProfileConnectionSpace(ColorConversionOptions, ReadOnlySpan<Hsv>, Span<Rgb>)

Converts the span of colors to the profile connection space.

public static void ToProfileConnectionSpace(ColorConversionOptions options, ReadOnlySpan<Hsv> source, Span<Rgb> destination)

Parameters

options ColorConversionOptions

The color profile conversion options.

source ReadOnlySpan<Hsv>

The color span to convert from.

destination Span<Rgb>

The color profile span to write the results to.

ToScaledVector4()

Expands the pixel into a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1. The vector components are typically expanded in least to greatest significance order.

public Vector4 ToScaledVector4()

Returns

Vector4

The Vector4.

ToScaledVector4(ReadOnlySpan<Hsv>, Span<Vector4>)

Converts the span of colors to a generic ("scaled") Vector4 representation with values scaled and clamped between 0 and 1.

public static void ToScaledVector4(ReadOnlySpan<Hsv> source, Span<Vector4> destination)

Parameters

source ReadOnlySpan<Hsv>

The color span to convert from.

destination Span<Vector4>

The vector span to write the results to.

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.

Operators

operator ==(Hsv, Hsv)

Compares two Hsv objects for equality.

public static bool operator ==(Hsv left, Hsv right)

Parameters

left Hsv

The Hsv on the left side of the operand.

right Hsv

The Hsv on the right side of the operand.

Returns

bool

True if the current left is equal to the right parameter; otherwise, false.

operator !=(Hsv, Hsv)

Compares two Hsv objects for inequality.

public static bool operator !=(Hsv left, Hsv right)

Parameters

left Hsv

The Hsv on the left side of the operand.

right Hsv

The Hsv on the right side of the operand.

Returns

bool

True if the current left is unequal to the right parameter; otherwise, false.