|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
550 bytes
|
| Line | |
|---|
| 1 | import {hsl as colorHsl} from "d3-color";
|
|---|
| 2 | import color, {hue} from "./color.js";
|
|---|
| 3 |
|
|---|
| 4 | function hsl(hue) {
|
|---|
| 5 | return function(start, end) {
|
|---|
| 6 | var h = hue((start = colorHsl(start)).h, (end = colorHsl(end)).h),
|
|---|
| 7 | s = color(start.s, end.s),
|
|---|
| 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.s = s(t);
|
|---|
| 13 | start.l = l(t);
|
|---|
| 14 | start.opacity = opacity(t);
|
|---|
| 15 | return start + "";
|
|---|
| 16 | };
|
|---|
| 17 | }
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | export default hsl(hue);
|
|---|
| 21 | export var hslLong = hsl(color);
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.