Skip to content

Please change color scheme

Closed

Description

I've read through #802 and #590

I believe I've found where the issue lies:
Snippet from base.js
https://github.com/visionmedia/mocha/blob/master/lib/reporters/base.js

exports.colors = {
    'pass': 90
  , 'fail': 31
  , 'bright pass': 92
  , 'bright fail': 91
  , 'bright yellow': 93
  , 'pending': 36
  , 'suite': 0
  , 'error title': 0
  , 'error message': 31
  , 'error stack': 90
  , 'checkmark': 32
  , 'fast': 90
  , 'medium': 33
  , 'slow': 31
  , 'green': 32
  , 'light': 90
  , 'diff gutter': 90
  , 'diff added': 42
  , 'diff removed': 41
};

var color = exports.color = function(type, str) {
  if (!exports.useColors) return str;
  return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
};

So the color function takes in a type and uses the conversion table above to get the ANSI escape color.
A chart can be found here:
http://en.wikipedia.org/wiki/ANSI_escape_code#CSI_codes

As you can see:
screenshot from 2014-04-25 03 09 43

Seems to be a closed-source terminal from IBM AIX.
I believe nobody is using mocha on it. (Correct me if I'm wrong)

Furthermore, I found the ECMA specification:
http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
Here is page 62:
mocha2

Color 90-99 are not in the specification. Most terminals wouldn't care implementing these colors correctly and god knows what color they'll fall back into.
And not everyone uses iTerm2, which has a contrast setting.
Please use color 30-37, if you want increased intensity then \u001b[30;1m would use the intense variant.
I think users are only responsible for configuring their terminals so the 16 colors look great on their bg/fg colors. So please don't just say "It's the theme's fault" and close the issue. It's mocha's problem not using color from the standard palette.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    type: choregenerally involving deps, tooling, configuration, etc.generally involving deps, tooling, configuration, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions