UNPKG

d3-scale-chromatic

Version:

Sequential, diverging and categorical color schemes.

12 lines (11 loc) 248 B
export default function(ranges) { ranges = ranges.map(function(colors) { return colors.match(/.{6}/g).map(function(x) { return "#" + x; }); }); var n0 = ranges[0].length; return function(n) { return ranges[n - n0]; }; }