Created
December 10, 2017 06:28
-
-
Save jaybo/98d21dc2012d89b8c20c5a9bfe17922e to your computer and use it in GitHub Desktop.
make_colormap.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let colormap = require('colormap') | |
var fs = require('fs'); | |
let map_name = 'bluered'; | |
let file_name = map_name + ".json" | |
let colors = colormap({ | |
colormap: map_name, | |
nshades: 100, | |
format: 'hex', | |
alpha: [1.0, 0.5, 1.0] | |
}) | |
var json_text = JSON.stringify(colors); | |
fs.writeFile(file_name, json_text, function(err) { | |
if(err) { | |
return console.log(err); | |
} | |
console.log("Created " + file_name); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment