Skip to main content
100%

HCL Interpolation

✓ Published0🌍 Public
Mmbostock
Last edited Feb 9, 2016
Created on Jun 3, 2015

This example demonstrates color interpolation in the CIELCH color space, showing how hue transitions along the shortest path between two colors. An animated gradient sweeps horizontally across a canvas, with the starting and ending hues continuously shifting over time. The visualization uses the `d3.interpolateHcl` function from the d3-color module and the `d3.timer` function from the d3-transition module to drive the animation and render the gradient pixels with Canvas `putImageData`.

AI-generated description

A simple test of interpolateHcl from the d3-color module, animated with timer from the d3-transition module. Note that interpolateHcl chooses the shortest path between two hues, and the change in hue is thus always less than 180°; use interpolateHclLong to take the long path.

gpl-3.0 Licensed

Similar vizzes