Skip to content

Commit

Permalink
Fix off-by-one.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbostock committed Apr 29, 2014
1 parent de6aac8 commit e92e4fe
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cubehelix/cubehelix.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ d3.scale.cubehelix = function() {
g = λ + a * (-0.29227 * Math.cos(φ) - 0.90649 * Math.sin(φ)),
b = λ + a * (+1.97294 * Math.cos(φ));
return d3.rgb(
(r <= 0 ? 0 : r >= 1 ? 1 : r) * 256 | 0,
(g <= 0 ? 0 : g >= 1 ? 1 : g) * 256 | 0,
(b <= 0 ? 0 : b >= 1 ? 1 : b) * 256 | 0
(r <= 0 ? 0 : r >= 1 ? 1 : r) * 255 | 0,
(g <= 0 ? 0 : g >= 1 ? 1 : g) * 255 | 0,
(b <= 0 ? 0 : b >= 1 ? 1 : b) * 255 | 0
);
}

Expand Down

0 comments on commit e92e4fe

Please sign in to comment.