You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
550 B

  1. import {hcl as colorHcl} from "d3-color";
  2. import color, {hue} from "./color.js";
  3. function hcl(hue) {
  4. return function(start, end) {
  5. var h = hue((start = colorHcl(start)).h, (end = colorHcl(end)).h),
  6. c = color(start.c, end.c),
  7. l = color(start.l, end.l),
  8. opacity = color(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. }
  17. }
  18. export default hcl(hue);
  19. export var hclLong = hcl(color);