Skip to main content
100%

A Less-Angry Rainbow

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jun 22, 2014

Three rainbow color scales are compared in two horizontal bands each, rendered as 1-pixel-high Canvas images stretched vertically. The first band shows the original colors, while the second band removes chroma (sets `c = 0` via `d3.hcl`) to reveal lightness variation. The scales include HSL, HCL, and a cubehelix scale built with `d3.scale.cubehelix` and a custom `d3.interpolateCubehelix` interpolation. The code uses D3 v3 and Canvas `putImageData` to draw each scale.

AI-generated description

Experimenting with a rainbow color scale that is cylical but has better perceptual properties. The HCL rainbow has roughly-constant luminance, but is ugly. The cubehelix rainbow, inspired by Matteo Niccoli’s <a href="http://mycarta.wordpress.com/2013/02/21/perceptual-rainbow-palette-the-method/">perceptual rainbow</a> but extended to 360°, varies in brightness but is prettier.

gpl-3.0 Licensed

Similar vizzes