@tempots/color

HSLA class

Represents the HSLA color model.

Signature:

declare class HSLA 

Constructors

Constructor

Modifiers

Description

(constructor)(hue, saturation, lightness, alpha)

Constructs a new instance of the HSLA class

Properties

Property

Modifiers

Type

Description

alpha

readonly

number

The alpha value of the HSLA color.

equals

readonly

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

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

hue

readonly

number

The hue value of the HSL color.

lightness

readonly

number

Represents the lightness value in the HSL color model.

saturation

readonly

number

The saturation value of an HSL color.

toString

readonly

() => string

Returns a string representation of the HSLA color in the format "hsla(hue, saturation%, lightness%, alpha)".

withAlpha

readonly

(alpha: number) => HSLA

Returns a new HSLA color with the specified alpha value.

withHue

readonly

(hue: number) => HSLA

Returns a new HSLA color with the specified hue.

withLightness

readonly

(lightness: number) => HSLA

Returns a new HSLA color with the specified lightness.

withSaturation

readonly

(saturation: number) => HSLA

Returns a new HSLA color with the specified saturation.