Skip to content

Commit c8b31f7

Browse files
committed
removed few unused variables and expanded colormap to support 256 colors
1 parent db6e868 commit c8b31f7

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Diff for: index.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ function createColormap (spec) {
1414
/*
1515
* Default Options
1616
*/
17-
var indicies, rgba, fromrgba, torgba,
17+
var indicies, fromrgba, torgba,
1818
nsteps, cmap, colormap, format,
19-
nshades, colors, alpha, index, i,
20-
r = [],
21-
g = [],
22-
b = [],
23-
a = [];
19+
nshades, colors, alpha, i;
2420

2521
if ( !spec ) spec = {};
2622

@@ -46,7 +42,7 @@ function createColormap (spec) {
4642
throw Error('unsupported colormap option', colormap);
4743
}
4844

49-
if (cmap.length > nshades) {
45+
if (cmap.length > nshades + 1) {
5046
throw new Error(
5147
colormap+' map requires nshades to be at least size '+cmap.length
5248
);

0 commit comments

Comments
 (0)