coloretic
v1.0.2
Published
A library for creating and manipulating various color spaces
Downloads
10
Maintainers
Readme
Coloretic
Library for creating and manipulating various color spaces
Features
- Immutability
- Fully typed
- Zero dependency
Quick start
- Install the package:
- with npm
npm i coloretic
- with yarn
yarn add coloretic
- with pnpm
pnpm i coloretic
- Use the package:
// Creating color
const red = createRGBColor({ red: 255, blue: 0, green: 0 })
const white = createRGBColor({ red: 255, blue: 255, green: 255 })
const black = createRGBColor({ red: 0, blue: 0, green: 0 })
// Change color
const violet = setBlue(255, red)
const yellow = setGreen(255, red)
const semiTransparentRed = transparentize(0.5, red)
// Converting colors
const hslRed = HSL2RGB(red)
// Operate with colors
const gray = mixRGB(white, black, 0.5)
const semiTransparentViolet = alphaBlendingRGB(
semiTransparentRed,
createRGBColor({ red: 0, green: 0, blue: 255, alpha: 0.5 }),
)
To learn more about what the library can do check out the 📚️ documentation
LICENCE MIT - Created by Timur Tokaev (@toombez)