Releases: ricokahler/color2k
v1.2.0-alpha.3
1.2.0-alpha.3 (2021-01-30)
Bug Fixes
v1.2.0-alpha.2
v1.2.0-alpha.1
v1.1.1
Display helpers
This release adds 3 new functions to help you display any color as a string.
toHex
: https://color2k.com/#to-hextoHsla
: https://color2k.com/#to-hslatoRgba
: https://color2k.com/#to-rgba
v1.0.0
Welcome to stable
Unfortunately due to the difficulties of SSR compatibility (i.e. the lack of conditional import support in sandboxed SSR environments) this lib has dropped getComputedStyle
support in favor of a pure JS implementation. This unfortunately increases bundle size but we've ensured this package is still the smallest of its kind (2.7kB now).
However, the benefit of parsing colors in JS is stability, so…
Here's 1.0 🎉
No dependencies and no browser limitations. Use anywhere.
Remove `getBrightness` and `darken`
After some more testing and real usage, brightness darken
and getBrightness
did not output what I had hoped for so this release removes getBrightness
and makes lightnessDarken
the new darken
.
This should be the final API set before 1.0 scheduled for June 11th.
JSDOM support
getComputedStyle
in JSDOM does not behave the same way as the browser. In order add support for JSDOM (and in turn, add support for JSDOM within Jest), an explicit check for JSDOM was added.
Small breaking change: the @color2k/node
package was renamed to @color2k/compat
and instead of being bundled as a commonjs (cjs
) module, it's now bundled as a UMD module. This makes it so that this module can be evaluated and used inside of JSDOM via eval w/ { runScripts: 'outside-only' }
.
See the tests for more details.
Note: if you'd like to run color2k inside of Jest with the environment
jest-environment-jsdom
, all you need to do is install@color2k/compat
Switch to getComputedStyle instead of canvas
Switches the canvas implementation to getComputedStyle
because it's faster.
`getScale`
This release adds a new API getScale
to mimic chroma-js's scale API.