Browse files

supporting bright background colors

  • Loading branch information...
1 parent 5c0c4a1 commit ccd7e90e302f9e3d2e3351a04f4439d730bb05fd @thlorenz committed Jan 12, 2013
Showing with 21 additions and 8 deletions.
  1. +16 −8 ansicolors.js
  2. +5 −0 test/ansicolors.js
View
24 ansicolors.js
@@ -20,14 +20,22 @@ var colorNums = {
, brightWhite : 97
}
, backgroundColorNums = {
- bgBlack : 40
- , bgRed : 41
- , bgGreen : 42
- , bgYellow : 43
- , bgBlue : 44
- , bgMagenta : 45
- , bgCyan : 46
- , bgWhite : 47
+ bgBlack : 40
+ , bgRed : 41
+ , bgGreen : 42
+ , bgYellow : 43
+ , bgBlue : 44
+ , bgMagenta : 45
+ , bgCyan : 46
+ , bgWhite : 47
+ , bgBrightBlack : 100
+ , bgBrightRed : 101
+ , bgBrightGreen : 102
+ , bgBrightYellow : 103
+ , bgBrightBlue : 104
+ , bgBrightMagenta : 105
+ , bgBrightCyan : 106
+ , bgBrightWhite : 107
}
, colors = {};
View
5 test/ansicolors.js
@@ -30,6 +30,11 @@ assert.equal(
, '\u001b[43mprinted with yellow background\u001b[49m'
);
assert.equal(
+ colors.bgBrightYellow('printed with bright yellow background')
+ , '\u001b[103mprinted with bright yellow background\u001b[49m'
+);
+
+assert.equal(
colors.bgWhite('printed with white background')
, '\u001b[47mprinted with white background\u001b[49m'
);

0 comments on commit ccd7e90

Please sign in to comment.