UNPKG

447 BJavaScriptView Raw
1import {lab as colorLab} from "d3-color";
2import color from "./color";
3
4export default function lab(start, end) {
5 var l = color((start = colorLab(start)).l, (end = colorLab(end)).l),
6 a = color(start.a, end.a),
7 b = color(start.b, end.b),
8 opacity = color(start.opacity, end.opacity);
9 return function(t) {
10 start.l = l(t);
11 start.a = a(t);
12 start.b = b(t);
13 start.opacity = opacity(t);
14 return start + "";
15 };
16}