4.1.0 • Published 5 years ago

@rocketstation/hsla v4.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

HSLA

HSLA creates, modifies, stringifies HSLA colors

Installation

npm i @rocketstation/hsla

Usage

import hsla from '@rocketstation/hsla'

console.log(hsla(0, 0, 0)()) // hsla(0, 0%, 0%, 1)
console.log(hsla('hsl(0, 0%, 0%)')()) // hsla(0, 0%, 0%, 1)

console.log(hsla(0, 0, 0, 100)()) // hsla(0, 0%, 0%, 1)
console.log(hsla('hsla(0, 0%, 0%, 1)')()) // hsla(0, 0%, 0%, 1)

console.log(hsla(0, 0, 0, 100)(50)) // hsla(0, 0%, 0%, 0.5)
console.log(hsla(0, 0, 0, 100)({ H: 360 S: 100 L: 100 A: 0 }) // hsla(360, 100%, 100%, 0)
console.log(hsla(180, 50, 50, 50)({ h: 180, s: 50, l: 50, a: -50 }) // hsla(360, 100%, 100%, 0)

console.log(hsla(999, 999, 999, 999)()) // hsla(360, 100%, 100%, 1)
console.log(hsla(-999, -999, -999, -999)()) // hsla(0, 0%, 0%, 0)
console.log(hsla(0.999, 0, 0)()) // hsla(1, 0%, 0%, 1)

Motivation

We were tired of writing this code again and again

License

HSLA is licensed under the MIT License

Created by RocketStation

4.1.0

5 years ago

4.0.0

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago

1.1.0

6 years ago

1.2.0

6 years ago

1.1.2

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago