* Adding for history; will be removed

This commit is contained in:
Bryan Ashby 2015-04-29 21:53:01 -06:00
parent 48be2f69be
commit 6f9414fc1c
2 changed files with 20 additions and 0 deletions

View file

@ -323,6 +323,25 @@ function sgr() {
return ESC_CSI + result + 'm';
}
function ansiFromColor(color) {
var sgrParams = [];
for(var k in color.styles) {
if(true === color.styles[k]) {
sgrParams.push(k);
}
}
if(color.fg) {
sgrParams.push(color.fg);
}
if(color.bg) {
sgrParams.push(color.bg);
}
return sgr(sgrParams);
}
///////////////////////////////////////////////////////////////////////////////
// Shortcuts for common functions
///////////////////////////////////////////////////////////////////////////////