- added chroma.noHueAsZero() to change the global behavior for colors with no hue (like black, white or grays) in color spaces which work internally with hue values (like LCH, HSL, ...). By default these colors returned a NaN hue value, but this behavior can now be changed to output always zero by using
chroma.noHueAsZero(true)
first at any time. See Issue 322 - added LAB, LCH, OKLCH and OKLAB support in
chroma.css()
Issue 325 - added LAB, LCH, OKLCH and OKLAB CSS support in "chroma()". i.e. CSS expressions are also interpreted as colors
chroma("lch(48.25% 30.07% 196.38)")
- added weights for every component at
chroma.distance()
(@lulunac27a) - added chroma.stdDeviation() to retrieve the variance in an array of colors as an RGBA component. See [Issue 328] (gka#328 (comment))
- added chroma.palette() to retrieve the n-most representative colors in an array of colors. See [Issue 328] (gka#328 (comment))
- improved support for OKLCH colors using
chroma.average()
orchroma.distance()
(@lulunac27a) - added 'supported color spaces' to documentation
- minor improvements to documentation
- fix wrong handling of RGB and RGBA arrays when constructing chroma color objects.
- fix wrong handling of values outside scale domain due to internal Math.pow usage. See Issue 331
- added
chroma.brewer.getPalettes()
to retrieve all available palettes (keys). ColorBrewer schemes (scales) are divided into palettes according to their type - added
chroma.brewer.getPalette(palette)
to retrieve all schemes from an specific palette (for ex. 'Qualitative') - added 'Diverging','Qualitative', and 'Sequential' scales to chroma.brewer and chroma.scale(), which will automatically retrieve a single random scale from the given palette. For ex.
chroma.scale('Sequential')
->chroma.scale('OrRd')
- chroma.brewer object can no longer be modified in any way (or its scales). Make a copy of it if required
- replace deprecated .substr usage
- fixed 'npm run docs-preview' CMD command
- minor improvements to documentation
- added favicons to documentation
- added Android colors support to 'light' build version, missing by error at 2.5.0
- added 'ultra-light' build version, to be used only for color conversion (no other features included)
- updated documentation with sticky index to left, independently scrollable
- updated documentation with 'Flavours' section
- general cleanup and styling of documentation
- updated dependencies to fix all known vulnerabilities. Documentation has been patched to use updated dependencies
- added alpha functionality to bezier interpolation (n-degree compatibility)
- added tests for alpha bezier interpolation
- updated dependencies
- updated documentation with Android colors
- updated documentation linking to new github page
- forked from 2.4.2 (no documented on changelog)
- added full Android colors compatibility. color.android(mode='rgb'). By default alpha is scrapped (like color.num()), set mode to 'rgba' to use alpha
- added tests for Android colors compatibility
- fix tests for documentation when using both \n or \r\n line feeds
- 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