Created
June 6, 2014 21:13
-
-
Save sentientwaffle/d9a6e046d639157a9c2c to your computer and use it in GitHub Desktop.
256 colors
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
function color(n) { | |
return '\u001b[38;5;' + n + 'm' | |
} | |
var clear_color = '\u001b[39m' | |
var str = "" | |
for (var i = 0; i < 256; i++) { | |
if (i && i % 32 === 0) str += "\n" | |
str += color(i) + "X" + clear_color | |
} | |
console.log(str) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment