Skip to content

Commit

Permalink
correct ansi colors for 16 colors environments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorik Tangelder committed Mar 21, 2016
1 parent ad8ab1d commit ee776c0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/report/common/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,13 @@ 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 basic = (supportsColor.level === 1);
var colors = {
low: basic ? '31;1' : 91,
medium: basic ? '33;1' : 93,
high: basic ? '32;1' : 92
};
return '\u001b[' + colors[clazz] + 'm' + str + '\u001b[0m';
}
return str;
},
Expand Down

0 comments on commit ee776c0

Please sign in to comment.