0.2.3 • Published 1 month ago

@barelyhuman/tocolor v0.2.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month ago

tocolor

Highlights

  • 🌳 Tree shakable
  • 🌟 ESM Support
  • 🦍 backed by tests
  • Supports conversions among RGB, HSL, L*a*b*, HEX, XYZ

Note: When dealing with XYZ and L*a*b*, the library uses the reference white point based on D65 and doesn't support changing the white point, right now

Installation

  npm install @barelyhuman/tocolor
  #or
  yarn add @barelyhuman/tocolor

Usage

import {hexToHSL, hslToHex} from '@barelyhuman/tocolor'

function darker(percentage, hex) {
	if (!percentage) {
		return this
	}
	const {h, s, l} = hexToHSL(hex)
	const _afterDarken = l - percentage
	const value = hslToHex(h, s, _afterDarken)
	return value
}

API Reference

API

Contributing

Contributions are always welcome!

Follow the general github flow of Fork => PR, make sure that you let the authors know about the issue you pick to avoid overlaps.

Authors

Support

For support, email ahoy@barelyhuman.dev

License

MIT

0.2.3

1 month ago

0.2.1

1 year ago

0.2.2

1 year ago

0.2.0

1 year ago

0.2.0-2

1 year ago

0.2.0-1

1 year ago

0.2.0-0

1 year ago

0.1.0

1 year ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago