UNPKG

495 BJavaScriptView Raw
1import {hcl} from "d3-color";
2import interpolateColor from "./color";
3
4export default function interpolateHclLong(start, end) {
5 var h = interpolateColor((start = hcl(start)).h, (end = hcl(end)).h),
6 c = interpolateColor(start.c, end.c),
7 l = interpolateColor(start.l, end.l),
8 opacity = interpolateColor(start.opacity, end.opacity);
9 return function(t) {
10 start.h = h(t);
11 start.c = c(t);
12 start.l = l(t);
13 start.opacity = opacity(t);
14 return start + "";
15 };
16}