1 | import {hcl as colorHcl} from "d3-color";
|
2 | import color, {hue} from "./color";
|
3 |
|
4 | function hcl(hue) {
|
5 | return function(start, end) {
|
6 | var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),
|
7 | c = color(start.c, end.c),
|
8 | l = color(start.l, end.l),
|
9 | opacity = color(start.opacity, end.opacity);
|
10 | return function(t) {
|
11 | start.h = h(t);
|
12 | start.c = c(t);
|
13 | start.l = l(t);
|
14 | start.opacity = opacity(t);
|
15 | return start + "";
|
16 | };
|
17 | }
|
18 | }
|
19 |
|
20 | export default hcl(hue);
|
21 | export var hclLong = hcl(color);
|