Skip to content

Commit

Permalink
removed few unused variables and expanded colormap to support 256 colors
Browse files Browse the repository at this point in the history
  • Loading branch information
archmoj committed Apr 1, 2019
1 parent db6e868 commit c8b31f7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ function createColormap (spec) {
/*
* Default Options
*/
var indicies, rgba, fromrgba, torgba,
var indicies, fromrgba, torgba,
nsteps, cmap, colormap, format,
nshades, colors, alpha, index, i,
r = [],
g = [],
b = [],
a = [];
nshades, colors, alpha, i;

if ( !spec ) spec = {};

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

if (cmap.length > nshades) {
if (cmap.length > nshades + 1) {
throw new Error(
colormap+' map requires nshades to be at least size '+cmap.length
);
Expand Down

0 comments on commit c8b31f7

Please sign in to comment.