Skip to content

Commit

Permalink
Cast color stop offset to number
Browse files Browse the repository at this point in the history
Will parse the offset to number so heatmap.js can be used with local jest tests (canvas node implementation).
closes pa7#330
  • Loading branch information
jesuino committed Dec 1, 2020
1 parent 4e64f5a commit 707d6a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/renderer/canvas2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var Canvas2dRenderer = (function Canvas2dRendererClosure() {

var gradient = paletteCtx.createLinearGradient(0, 0, 256, 1);
for (var key in gradientConfig) {
gradient.addColorStop(key, gradientConfig[key]);
gradient.addColorStop(+key, gradientConfig[key]);
}

paletteCtx.fillStyle = gradient;
Expand Down

0 comments on commit 707d6a4

Please sign in to comment.