使用方法:

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');
Chroma.js 1.3.0 发布,JavaScript 颜色处理库
Chroma.js 是一个可实现各种颜色的转换和颜色处理的微型 JavaScript 库。Chroma.js 1.3.0 版本更新如下:新增 chroma.distance新增 chroma.deltaEchroma.average 现在可使用任意颜色模式color.set 返回一个新的 chroma 实例浮动存储 RGB 以实现更高的精度chroma.scale 现在允许禁用内部缓存修复 ubehelix 和 cons

发布于 2017-04-05 00:20:41 | 130 次阅读


Copyright © 2007-2017 PHPERZ.COM All Rights Reserved   冀ICP备14009818号  版权声明  广告服务