Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

glow

JS color library. For parseing strings to colors and manipulating their value.

HSL is the main color space used to generate palettes. As it is the simplest space to work with. The other color spaces are provided to work with CSS, converting too and from HSL.

Supports HSL, RGB & Hex. As its intended for web use.

Converting between color spaces

Colors are initalised with string representation. RGB & HSL will accept an Array.

  let hsl = new HSL('hsl(0,0,92)')
  hsl.toHex().toString() // #EBEBEB
  hsl.toRgb().toString() // rgb(235,235,235)
  
  let rgb = new RGB('rgb(204,61,204)')
  rgb.toHex().toString() // #CC3DCC
  rgb.toHsl().toString() // hsl(300,58,52)
  
  let hex = new Hex('#72afd6')
  hex.toHsl().toString() // hsl(203,55,64)
  hex.toRgb().toString() // rgb(114,175,214)
  

Licence

This project is licensed under the terms of the MIT license.

About

JS colour

Resources

License

Releases

No releases published

Packages

No packages published