Skip to content

Commit

Permalink
Fix #68 - fix interpolateCubehelixDefault.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Jun 15, 2016
1 parent 87972e2 commit 9dab7c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/cubehelix.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import {cubehelix} from "d3-color";
import {interpolateCubehelixLong} from "d3-interpolate";

export default function() {
return interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));
}
export default interpolateCubehelixLong(cubehelix(300, 0.5, 0.0), cubehelix(-240, 0.5, 1.0));
11 changes: 11 additions & 0 deletions test/cubehelix-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var tape = require("tape"),
d3 = require("../");

tape("interpolateCubehelixDefault(t) returns the expected values", function(test) {
test.equal(d3.interpolateCubehelixDefault(0.0), "rgb(0, 0, 0)");
test.equal(d3.interpolateCubehelixDefault(0.2), "rgb(22, 61, 78)");
test.equal(d3.interpolateCubehelixDefault(0.5), "rgb(160, 121, 73)");
test.equal(d3.interpolateCubehelixDefault(0.8), "rgb(193, 202, 243)");
test.equal(d3.interpolateCubehelixDefault(1.0), "rgb(255, 255, 255)");
test.end();
});

0 comments on commit 9dab7c4

Please sign in to comment.