使用方法:
INitiate and manipulate colors:
chroma('#D4F880').darken().hex(); // #9BC04B
Working with color scales is easy, too:
scale = chroma.scale(['white', 'red']); scale(0.5).hex(); // #FF7F7F
Lab/Lch interpolation looks better than than RGB
chroma.scale(['white', 'red']).mode('lab');
Custom domains! Quantiles! Color Brewer!!
chroma.scale('RdYlBu').domain(myValues, 7, 'quantiles');
And why not use logarithmic color scales once in your life?
chroma.scale(['lightyellow', 'navy']).domain([1, 100000], 7, 'log');
发布于 2017-04-05 00:20:41 | 137 次阅读