|
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:
506 bytes
|
| Rev | Line | |
|---|
| [e4c61dd] | 1 | import {cubehelix} from "d3-color";
|
|---|
| 2 | import {interpolateCubehelixLong} from "d3-interpolate";
|
|---|
| 3 |
|
|---|
| 4 | export var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
|
|---|
| 5 |
|
|---|
| 6 | export var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
|
|---|
| 7 |
|
|---|
| 8 | var c = cubehelix();
|
|---|
| 9 |
|
|---|
| 10 | export default function(t) {
|
|---|
| 11 | if (t < 0 || t > 1) t -= Math.floor(t);
|
|---|
| 12 | var ts = Math.abs(t - 0.5);
|
|---|
| 13 | c.h = 360 * t - 100;
|
|---|
| 14 | c.s = 1.5 - 1.5 * ts;
|
|---|
| 15 | c.l = 0.8 - 0.9 * ts;
|
|---|
| 16 | return c + "";
|
|---|
| 17 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.