hex-to-hsl

Convert a hex color string to an hsl array

Usage no npm install needed!

<script type="module">
  import hexToHsl from 'https://cdn.skypack.dev/hex-to-hsl';
</script>

README

HEX to HSL

Build Status

Convert a HEX color string to an HSL value

Install

npm install hex-to-hsl --save

Use

var hexToHsl = require('hex-to-hsl');

console.log(hexToHsl('#0593FF')); // Prints [206, 100, 51]
console.log(hexToHsl('#00C176')); // Prints [157, 100, 38]
console.log(hexToHsl('#fff')); // Prints [0, 0, 100]