Class pv.Color.Hsl
Extends
pv.Color.
Represents a color in HSL space.
Defined in: Color.js.
Constructor Attributes | Constructor Name and Description |
---|---|
pv.Color.Hsl(h, s, l, a)
Constructs a new HSL color with the specified values.
|
Field Attributes | Field Name and Description |
---|---|
The opacity, a float in [0, 1].
|
|
The hue, an integer in [0, 360].
|
|
The lightness, a float in [0, 1].
|
|
The saturation, a float in [0, 1].
|
Method Attributes | Method Name and Description |
---|---|
alpha(a)
Constructs a new HSL color with the same hue, saturation and lightness as
this color, and the specified alpha.
|
|
hue(h)
Constructs a new HSL color with the same saturation, lightness and alpha as
this color, and the specified hue.
|
|
lightness(l)
Constructs a new HSL color with the same hue, saturation and alpha as this
color, and the specified lightness.
|
|
rgb()
Returns the RGB color equivalent to this HSL color.
|
|
saturation(s)
Constructs a new HSL color with the same hue, lightness and alpha as this
color, and the specified saturation.
|
Class Detail
pv.Color.Hsl(h, s, l, a)
Constructs a new HSL color with the specified values.
- Parameters:
- {number} h
- the hue, an integer in [0, 360].
- {number} s
- the saturation, a float in [0, 1].
- {number} l
- the lightness, a float in [0, 1].
- {number} a
- the opacity, a float in [0, 1].
Field Detail
{number}
a
The opacity, a float in [0, 1].
{number}
h
The hue, an integer in [0, 360].
{number}
l
The lightness, a float in [0, 1].
{number}
s
The saturation, a float in [0, 1].
Method Detail
alpha(a)
Constructs a new HSL color with the same hue, saturation and lightness as
this color, and the specified alpha.
- Parameters:
- {number} a
- the opacity, a float in [0, 1].
hue(h)
Constructs a new HSL color with the same saturation, lightness and alpha as
this color, and the specified hue.
- Parameters:
- {number} h
- the hue, an integer in [0, 360].
lightness(l)
Constructs a new HSL color with the same hue, saturation and alpha as this
color, and the specified lightness.
- Parameters:
- {number} l
- the lightness, a float in [0, 1].
{pv.Color.Rgb}
rgb()
Returns the RGB color equivalent to this HSL color.
- Returns:
- {pv.Color.Rgb} an RGB color.
saturation(s)
Constructs a new HSL color with the same hue, lightness and alpha as this
color, and the specified saturation.
- Parameters:
- {number} s
- the saturation, a float in [0, 1].