Marak / colors.js

get colors in your node.js console
https://github.com/Marak/colors.js
Other
5.16k stars 446 forks source link

Give end-users more options when NPM packages use colors.js #281

Open snoblenet opened 3 years ago

snoblenet commented 3 years ago

Popular NPM packages often use colors.js (or similar tools) in a way that makes unreasonable assumptions about the colour schemes that end users have in our terminals.

As a result, we users have to choose between disabling all colours or having messed up colours.

Can we have a third option please?

Perhaps a .colors.json file that we can place at the root of each project that uses an NPM package that uses colors.js?

For example, here is newman with FORCE_COLOR=1:

image

On the up side, the ticks are green like you'd hope.

On the down side, the debug text is the same colour as the background and therefore invisible.

And here is newman with FORCE_COLOR=0:

image

It works, but is quite disappointing.

I'd imagine putting something like this in a .colors.json file:

{
  "transforms": {
    "blue": "white"
  }
}
ferrybig commented 3 years ago

Most terminal interfaces come with options to manually modify the colors, typically also located in the theming interface.

Use this screen to rebind the colors that conflict with your background

Example on Windows: afbeelding (image from https://www.wikihow.com/Change-Colours-in-Command-Prompt)

Example on Ubuntu: afbeelding