colors.js icon indicating copy to clipboard operation
colors.js copied to clipboard

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

Open snoblenet opened this issue 4 years ago • 1 comments

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"
  }
}

snoblenet avatar Jun 16 '21 22:06 snoblenet

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

ferrybig avatar Aug 20 '21 13:08 ferrybig