6.0.6 • Published 7 years ago

husl v6.0.6

Weekly downloads
4,270
License
MIT
Repository
github
Last release
7 years ago

DEPRECATED

Identical functionality is provided under a new name: HSLuv.

Package: https://www.npmjs.com/package/hsluv Documentation: https://github.com/hsluv/hsluv/tree/master/javascript

Usage

husl.toHex(hue, saturation, lightness)

hue is a number between 0 and 360, saturation and lightness are numbers between 0 and 100. This function returns the resulting color as a hex string.

husl.toRGB(hue, saturation, lightness)

Like above, but returns an array of 3 numbers between 0 and 1, for the r, g, and b channel.

husl.fromHex(hex)

Takes a hex string and returns the HUSL color as array that contains the hue (0-360), saturation(0-100) and lightness(0-100) channel. Note: The result can have rounding errors. For example saturation can be 100.00000000000007

husl.fromRGB(red, green, blue)

Like above, but red, green and blue are passed as numbers between 0 and 1.

Use husl.p.toHex, husl.p.toRGB, husl.p.fromHex and husl.p.fromRGB for the pastel variant (HUSLp). Note that HUSLp does not contain all the colors of RGB, so converting arbitrary RGB to it may generate invalid HUSLp colors.

6.0.6

7 years ago

6.0.5

7 years ago

6.0.4

7 years ago

6.0.3

7 years ago

6.0.2-alpha.4

7 years ago

6.0.2-alpha.3

7 years ago

6.0.2-alpha.2

7 years ago

6.0.2-alpha.1

7 years ago

6.0.2

7 years ago

6.0.1

9 years ago

6.0.0

9 years ago

5.0.3

9 years ago

5.0.2

9 years ago

5.0.1

10 years ago

5.0.0

10 years ago

4.0.3

10 years ago

4.0.2

10 years ago

4.0.1

10 years ago

4.0.0

10 years ago

3.0.0

10 years ago

2.0.0

12 years ago

1.0.2

12 years ago

1.0.1

12 years ago

1.0.0

12 years ago