Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

30 строки
763 B

  1. import {cubehelix as colorCubehelix} from "d3-color";
  2. import color, {hue} from "./color.js";
  3. function cubehelix(hue) {
  4. return (function cubehelixGamma(y) {
  5. y = +y;
  6. function cubehelix(start, end) {
  7. var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),
  8. s = color(start.s, end.s),
  9. l = color(start.l, end.l),
  10. opacity = color(start.opacity, end.opacity);
  11. return function(t) {
  12. start.h = h(t);
  13. start.s = s(t);
  14. start.l = l(Math.pow(t, y));
  15. start.opacity = opacity(t);
  16. return start + "";
  17. };
  18. }
  19. cubehelix.gamma = cubehelixGamma;
  20. return cubehelix;
  21. })(1);
  22. }
  23. export default cubehelix(hue);
  24. export var cubehelixLong = cubehelix(color);