Skip to content

Commit

Permalink
Merge pull request #579 from jtangelder/fix-colors
Browse files Browse the repository at this point in the history
correct ansi colors for 16 colors environments
  • Loading branch information
gotwarlost committed Apr 6, 2016
2 parents a556a5e + 0411600 commit bb5b6e1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/report/common/defaults.js
Expand Up @@ -24,12 +24,14 @@ module.exports = {

colorize: function (str, clazz) {
/* istanbul ignore if: untestable in batch mode */
if (supportsColor) {
switch (clazz) {
case 'low' : str = '\x1B[91m' + str + '\x1B[0m'; break;
case 'medium': str = '\x1B[93m' + str + '\x1B[0m'; break;
case 'high': str = '\x1B[92m' + str + '\x1B[0m'; break;
}
var colors = {
low: '31;1',
medium: '33;1',
high: '32;1'
};

if (supportsColor && colors[clazz]) {
return '\u001b[' + colors[clazz] + 'm' + str + '\u001b[0m';
}
return str;
},
Expand Down

0 comments on commit bb5b6e1

Please sign in to comment.