A D3 linear scale that provides an implementation of Dave Green’s cubehelix color scheme.
See bl.ocks.org/11413789 for an example.
# d3.scale.cubehelix
Constructs a new linear cubehelix scale with the default domain [0, 1] and range parameters.
# cubehelix.startHue([startHue])
Specifies the starting hue of the range in degrees. The smallest value in the domain is mapped to this hue. If no argument is specified, returns the scale’s current starting hue, which defaults to 420°.
To convert from the original color scheme’s START parameter, use the following equality: startHue = (START / 3 + 1) * 360.
# cubehelix.endHue([endHue])
Specifies the ending hue of the range in degrees. The smallest value in the domain is mapped to this hue. If no argument is specified, returns the scale’s current ending hue, which defaults to -120°.
To convert from the original color scheme’s START and ROTS parameters, use the following equality: endHue = (START / 3 + 1 + ROTS) * 360.
# cubehelix.saturation([saturation])
Specifies the average saturation of colors in the output range. If no argument is specified, returns the scale’s current average saturation, which defaults to 0.6.
To convert from the original color scheme’s HUE parameter, use the following equality: saturation = HUE / 2.
# cubehelix.gamma([gamma])
Specifies the gamma correction value. If no argument is specified, returns the scale’s current gamma correction value, which defaults to 1.
# cubehelix.domain([domain])
Sets the scale’s domain; see linear.domain.
# cubehelix.nice([nice])
Nices the scale’s domain; see linear.nice.
# cubehelix.clamp([clamp])
Clamps the scale’s domain; see linear.clamp.