JSPM

float-hsl2rgb

1.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 515
  • Score
    100M100P100Q103980F
  • License MIT

converts [H,S,L] to [R,G,B]

Package Exports

  • float-hsl2rgb

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (float-hsl2rgb) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

float-hsl2rgb

stable

Converts [H,S,L] to [R,G,B].

var hsl2rgb = require('float-hsl2rgb')

var hsl = [180/360, 0.25, 0.50]

var rgb = hsl2rgb(hsl)
// -> [0.375, 0.625, 0.625]

All input/output uses the range [0 .. 1] for consistency and composition with other modules.

Usage

NPM

rgb = hsl2rgb(hsl)

Takes the hsl float array [H, S, L] and returns an [R, G, B] float representation.

Motivation

This was adapted from @harthur's wonderful color-convert module. Often I found myself only needing one function rather than all of them, and consistent input/output lends well to composition with other modules and WebGL.

License

MIT, see LICENSE.md for details.