color scale
✓ Published0🌍 Public
AAlec Burch
Last edited Jun 15, 2016
Created on Jun 15, 2016
This example displays a two-dimensional color gradient across a 960-by-500 canvas, with hue and lightness varying along the horizontal and vertical axes. The code uses D3 v4’s `d3.hcl` color space to generate colors, then paints each pixel individually via the Canvas 2D API’s `fillRect`. It also loads the d3-hsv and d3-scale-chromatic modules for extended color support, though only HCL values are used in the final rendering. The nested `d3.range` loops iterate over every x and y coordinate to fill the canvas with a smooth, continuous color field.
AI-generated descriptionbuilt during d3 fun time with kai chang