- fixed a bug in Lch interpolation of hue-less colors
- fix: allow deep-imports in vite projects
- feat: parse
'transparent'
as black with 0% opacity - resolves #280 - make it easier to access colorbrewer palette names - resolves #314
- docs: explain differences to official colorbrewer scales - resolves #316
- fix: correct parsing of modern css colors with percentage alpha - resolves #297
- fix: css output for hue-less colors in lch() and oklch() - resolves #357
- 🎉 NEW: Add support for modern CSS color spaces. This means you can now export and parse CSS colors in
lab()
,lch()
,oklab()
,oklch()
space. - 🎉 NEW: you can now control the standard white reference point for the CIE Lab and CIE Lch color spaces via
setLabWhitePoint
. - Breaking:
color.css()
will no longer return legacy CSS colors likergb(255, 255, 0)
but use modern CSS colors likergb(255 255 0)
instead. - fix: you can now use chroma.js both via the default export as well as named exports in ES6.
- fix: switch to W3C implementation of OKLab color space
- 🎉 NEW: add
color.shade()
,color.tint()
. - fix: remove false w3c color cornflower
- refactored code base to ES6 modules
- add support for Oklab and Oklch color spaces
- use binom of degree n in chroma.bezier
- use Delta e2000 for chroma.deltaE #269
- hsl2rgb will, like other x2rgb conversions now set the default alpha to 1
- use a more mangle-safe check for Color class constructor to fix issues with uglifyjs and terser
- added
chroma.valid()
for checking if a color can be parsed by chroma.js
- chroma.js has been ported from CoffeeScript to ES6! This means you can now import parts of chroma in your projects!
- changed HCG input space from [0..360,0..100,0..100] to [0..360,0..1,0..1] (to be in line with HSL)
- added new object unpacking (e.g.
hsl2rgb({h,s,l})
) - changed default interpolation to
lrgb
in mix/interpolate and average. - if colors can't be parsed correctly, chroma will now throw Errors instead of silently failing with console.errors
- chroma.scale() now interprets
null
as NaN and returns the fallback color. Before it had interpretednull
as0
- added
scale.nodata()
to allow customizing the previously hard-coded fallback (aka "no data") color #cccccc
- color.hex() now automatically sets the mode to 'rgba' if the colors alpha channel is < 1. so
chroma('rgba(255,0,0,.5)').hex()
will now return"#ff000080"
instead of"#ff0000"
. if this is not what you want, you must explicitly set the mode torgb
using.hex("rgb")
. - bugfix in chroma.average in LRGB mode (#187)
- chroma.scale now also works with just one color (#180)
- added LRGB interpolation
- passing null as mode in scale.colors will return chroma objects
- added color.clipped
- added chroma.distance
- added chroma.deltaE
- color.set now returns a new chroma instance
- chroma.scale now allows disabling of internal cache
- chroma.average now works with any color mode
- added unit tests for color conversions
- use hex colors as default string representation
- RGB channels are now stored as floats internally for higher precision
- bugfix with cubehelix and constant lightness
- bugfix in chroma.limits quantiles
- bugfix when running scale.colors(1)
- bugfix in hsi2rgb color conversion
- scale.colors() now returns the original colors instead of just min/max range
- added chroma.average for averaging colors
- refactored chroma.scale
- changed behaviour of scale.domain
- added scale.classes
- added scale.padding
- standardized alpha channel construction
- chroma.bezier automatically returns chroma.scale
- added simple color output to chroma.scale().colors()
- numeric interpolation does what it should
- refactored and modularized code base
- changed argument order of Color::interpolate