Skip to content

Commit

Permalink
supporting bright background colors
Browse files Browse the repository at this point in the history
  • Loading branch information
thlorenz committed Jan 12, 2013
1 parent 5c0c4a1 commit ccd7e90
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
24 changes: 16 additions & 8 deletions ansicolors.js
Expand Up @@ -20,14 +20,22 @@ var colorNums = {
, brightWhite : 97 , brightWhite : 97
} }
, backgroundColorNums = { , backgroundColorNums = {
bgBlack : 40 bgBlack : 40
, bgRed : 41 , bgRed : 41
, bgGreen : 42 , bgGreen : 42
, bgYellow : 43 , bgYellow : 43
, bgBlue : 44 , bgBlue : 44
, bgMagenta : 45 , bgMagenta : 45
, bgCyan : 46 , bgCyan : 46
, bgWhite : 47 , bgWhite : 47
, bgBrightBlack : 100
, bgBrightRed : 101
, bgBrightGreen : 102
, bgBrightYellow : 103
, bgBrightBlue : 104
, bgBrightMagenta : 105
, bgBrightCyan : 106
, bgBrightWhite : 107
} }
, colors = {}; , colors = {};


Expand Down
5 changes: 5 additions & 0 deletions test/ansicolors.js
Expand Up @@ -29,6 +29,11 @@ assert.equal(
colors.bgYellow('printed with yellow background') colors.bgYellow('printed with yellow background')
, '\u001b[43mprinted with yellow background\u001b[49m' , '\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( assert.equal(
colors.bgWhite('printed with white background') colors.bgWhite('printed with white background')
, '\u001b[47mprinted with white background\u001b[49m' , '\u001b[47mprinted with white background\u001b[49m'
Expand Down

0 comments on commit ccd7e90

Please sign in to comment.