Skip to content

Commit

Permalink
+ bg colors
Browse files Browse the repository at this point in the history
  • Loading branch information
devgru committed Aug 27, 2010
1 parent 73a106c commit e7be2e8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion colors.js
Expand Up @@ -32,14 +32,18 @@ var extras = {

var esc = function (str) { return "\x1B[" + str + 'm'; }

this.fg = {};
this.bg = {};
this.reset = esc(0);

this.generate = function (fore, back, extra) {
return esc(fg[fore] + ';' + bg[back] + extras[extra];
}

for (var c in colors) {
exports[c] = esc(colors[c]);
exports[c] = esc(colors[c] + 30);
exports.fg[c] = exports[c];
exports.bg[c] = esc(colors[c] + 40);
}

for (var e in extras) {
Expand Down

0 comments on commit e7be2e8

Please sign in to comment.