d3 / d3-color

Color spaces! RGB, HSL, Cubehelix, CIELAB, and more.
https://d3js.org/d3-color
ISC License
398 stars 91 forks source link

Default cubehelix color interpolators? #12

Closed mbostock closed 9 years ago

mbostock commented 9 years ago

Maybe this should be in d3-scale, but it would be nice to have some standard Cubehelix color scales:

var defaultCubehelix = color.interpolateCubehelix(
  color.cubehelix(300, 0.5, 0.0),
  color.cubehelix(-240, 0.5, 1.0)
);

var perceptualRainbow1 = color.interpolateCubehelix(
  color.cubehelix(-100, 0.75, 0.35),
  color.cubehelix(80, 1.50, 0.8)
);

var perceptualRainbow2 = color.interpolateCubehelix(
  color.cubehelix(80, 1.50, 0.8),
  color.cubehelix(260, 0.75, 0.35)
);
mbostock commented 9 years ago

OK, fixed in d3-scale.