0.0.1 • Published 1 year ago

@foundit/colorutils v0.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Color utils

Color utils is a small library of color manipulating functions.

Most color takes a color object as input. At minimum it looks like this:

{hue: 10, saturation: 20, lightness: 30}

However there is helper functions that translates a string of hex color (#BADA55) or web hsl (hsl(10, 20%, 30%)) into a color object.

const clrObj = hexToObject('#BADA55')

All functions

autoCssVarOnEvent, cssVarToColorObject, webHslToObject, hexToWebRGB, hexToWebHsl, colorObjToWeb, hexToObject, rgbToObject, hslToObject, rotateHue, getComplementary, getTriadic, saturate, desaturate, lighten, darken, isGrayscale, filterDarkColors, filterlightColors, compareLightness, compareSaturation, compareHue, normalizeSaturation, normalizeLightness, normalizeHue,

Commands

commandDescription
npx changesetCreate a changeset
pnpm run buildBuild out esm/mjs files
pnpm run lintCheck that ts ok