source: node_modules/d3-scale-chromatic/src/sequential-multi/rainbow.js@ e4c61dd

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
RevLine 
[e4c61dd]1import {cubehelix} from "d3-color";
2import {interpolateCubehelixLong} from "d3-interpolate";
3
4export var warm = interpolateCubehelixLong(cubehelix(-100, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
5
6export var cool = interpolateCubehelixLong(cubehelix(260, 0.75, 0.35), cubehelix(80, 1.50, 0.8));
7
8var c = cubehelix();
9
10export 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.