API Docs for: 3.8.0
Show:

Color.HSL Class

Module: color-hsl
Parent Module: color

Color provides static methods for color conversion to hsl values.

Y.Color.toHSL('f00'); // hsl(0, 100%, 50%)

Y.Color.toHSLA('rgb(255, 255, 0'); // hsla(60, 100%, 50%, 1)

Item Index

Properties

Methods

_hslToRgb

(
  • str
  • [toArray]
)
String | Array protected

Defined in color/js/color-hsl.js:135

Available since 3.8.0

Parses the HSL string into r, b, g values. Will return an Array of values or an RGB string.

Parameters:

Returns:

_hueToRGB

(
  • p
  • q
  • hue
)
Number protected

Defined in color/js/color-hsl.js:177

Available since 3.8.0

Converts the HSL hue to the different channels for RGB

Parameters:

Returns:

Number: value for requested channel

_rgbToHsl

(
  • str
  • [toArray]
)
String | Array protected

Defined in color/js/color-hsl.js:69

Available since 3.8.0

Parses the RGB string into h, s, l values. Will return an Array of values or an HSL string.

Parameters:

Returns:

toHSL

(
  • str
)
String public

Defined in color/js/color-hsl.js:43

Available since 3.8.0

Converts provided color value to an HSL string.

Parameters:

Returns:

toHSLA

(
  • str
)
String public

Defined in color/js/color-hsl.js:56

Available since 3.8.0

Converts provided color value to an HSLA string.

Parameters:

Returns:

Properties

REGEX_HSL

RegExp static

Defined in color/js/color-hsl.js:16

Available since 3.8.0

Default: /hsla?\(([.\d]*), ?([.\d]*)%, ?([.\d]*)%,? ?([.\d]*)?\)/

STR_HSL

String static

Defined in color/js/color-hsl.js:25

Available since 3.8.0

Default: hsl({*}, {*}%, {*}%)

STR_HSLA

String static

Defined in color/js/color-hsl.js:34

Available since 3.8.0

Default: hsla({*}, {*}%, {*}%, {*})