Created
October 13, 2012 08:08
-
-
Save leizongmin/3883759 to your computer and use it in GitHub Desktop.
控制台颜色
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
var text = 'Text'; | |
var split = [' ', ' ', ' ', ' ', '\n']; | |
var i = 0; | |
for (var c = 30; c <= 39; c++) { | |
for (var bg = 40; bg <= 49; bg++) { | |
[1,2,4,5,7,22,24,25,27].forEach(function (s) { | |
var v = [c, bg, s].join(';'); | |
var sp = split[i++]; | |
if (i >= split.length) i = 0; | |
process.stdout.write(v + ' \x1B[' + v + 'm' + text + '\x1B[39;49m' + sp); | |
}); | |
console.log('\n----------------------------------------------\n'); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment