@tempots/color

HSV class

Represents a color in the HSV (Hue, Saturation, Value) color model.

Signature:

declare class HSV 

Constructors

Constructor

Modifiers

Description

(constructor)(hue, saturation, value)

Constructs a new instance of the HSV class

Properties

Property

Modifiers

Type

Description

equals

readonly

(other: HSV, tollerance?: number) => boolean

Checks if the current HSV color is equal to another HSV color.

fromString

static

readonly

(s: string) => HSV

Creates an HSV color object from a string representation. The string should be in the format "hsv(h, s%, v%)" where h, s, and v are numeric values.

hue

readonly

number

Represents the hue value in the HSV color model.

ofChannels

static

readonly

([hue, saturation, value]: [hue: number, saturation: number, value: number]) => HSV

Creates an HSV color from individual channel values.

saturation

readonly

number

The saturation value of the HSV color model.

toChannels

readonly

() => [number, number, number]

Converts the HSV color representation to an array of channels.

toString

readonly

() => string

Returns a string representation of the HSV color. The format of the string is "hsv(hue, saturation, value)".

value

readonly

number

The value component of the HSV color model.

withHue

readonly

(h: number) => HSV

Returns a new HSV color with the specified hue value.

withSaturation

readonly

(s: number) => HSV

Returns a new HSV color with the specified saturation.

withValue

readonly

(v: number) => HSV

Returns a new HSV color with the specified value.