Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/omegatools/hsl

Deno HSL Color Conversion Module
https://github.com/omegatools/hsl

cmyk color conversion deno hex hsl library module rgb

Last synced: 5 days ago
JSON representation

Deno HSL Color Conversion Module

Awesome Lists containing this project

README

        


[![Badge Stars]][#]   
[![Badge Deno]][Deno]




# HSL

*Convert colors to HSL.*


[![Button Usage]][Usage]   
[![Button Conversions]][Conversions]




## Examples


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


### RGB

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

const hsl = HSL.fromRGB(rgb);

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


### Hex

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

const hsl = HSL.fromHex(hex);

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


### CMYK

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

const hsl = HSL.fromCMYK(cmyk);

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


[Conversions]: Documentation/Conversions.md
[License]: LICENSE
[Usage]: Documentation/Usage.md
[Deno]: https://deno.land/x/hsl
[#]: #

[Badge License]: https://img.shields.io/badge/License-AGPL3-015d93.svg?style=for-the-badge&labelColor=blue
[Badge Stars]: https://img.shields.io/github/stars/OmegaTools/HSL?style=for-the-badge&logoColor=white&logo=Trustpilot&labelColor=FF66AA&color=cf538b
[Badge Deno]: https://img.shields.io/badge/-Deno-58a341?style=for-the-badge&logoColor=white&logo=Deno&labelColor=64bc4b

[Button Conversions]: https://img.shields.io/badge/Conversions-64BC4B?style=for-the-badge&logoColor=white&logo=Betfair
[Button Usage]: https://img.shields.io/badge/Usage-04ACE6?style=for-the-badge&logoColor=white&logo=GitBook