Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Latest commit

 

History

History
97 lines (58 loc) · 1.75 KB

File metadata and controls

97 lines (58 loc) · 1.75 KB

Badge Stars    Badge Deno



HSL

Convert colors to HSL.


Button Usage    Button Conversions



Examples


import * as HSL from 'https://deno.land/x/hsl/mod.ts';

RGB

const rgb = [ 255 , 0 , 0 ]; // Red

const hsl = HSL.fromRGB(rgb);

console.log(hsl); // [ 0 , 100 , 50 ]

Hex

const hex = '#0000FF'; // Blue

const hsl = HSL.fromHex(hex);

console.log(hsl); // [ 240 , 100 , 50 ]

CMYK

const cmyk = [ 100 , 0 , 100 , 0 ]; // Green

const hsl = HSL.fromCMYK(cmyk);

console.log(hsl); // [ 120 , 100 , 50 ]