Show:
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)

Index

Properties

Methods

_hslToRgb

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

Defined in yui3/src/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:

  • str String
  • [toArray] Boolean optional

Returns:

String | Array:

_hueToRGB

(
  • p
  • q
  • hue
)
Number protected

Defined in yui3/src/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 yui3/src/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:

  • str String
  • [toArray] Boolean optional

Returns:

String | Array:

toHSL

(
  • str
)
String public

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

Available since 3.8.0

Converts provided color value to an HSL string.

Parameters:

  • str String

Returns:

String:

toHSLA

(
  • str
)
String public

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

Available since 3.8.0

Converts provided color value to an HSLA string.

Parameters:

  • str String

Returns:

String:

Properties

REGEX_HSL

RegExp static

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

Available since 3.8.0

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

STR_HSL

String static

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

Available since 3.8.0

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

STR_HSLA

String static

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

Available since 3.8.0

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