* Update color parsing. WIP

This commit is contained in:
Bryan Ashby 2014-11-03 17:04:46 -07:00
parent 6c841105ab
commit 1264cdde01
1 changed files with 12 additions and 1 deletions

View File

@ -274,7 +274,7 @@ function ANSIEscapeParser(options) {
for(i = 0, len = args.length; i < len; ++i) {
arg = args[i];
if(0x00 === arg) {
/*if(0x00 === arg) {
self.flags = 0x00;
self.resetColor();
} else {
@ -286,6 +286,17 @@ function ANSIEscapeParser(options) {
//case 4 : self.bgColor = arg - 40; break;
}
}
*/
if(arg >= 30 && arg <= 37) {
self.fgColor = arg;
} else if(arg >= 40 && arg <= 47) {
self.bgColor = arg;
} else {
self.flags = arg;
if(0 === arg) {
self.resetColor();
}
}
}
break;