nmattia / niv

Easy dependency management for Nix projects
https://github.com/nmattia/niv
MIT License
1.55k stars 77 forks source link

Tracked dependency names get printed in white; not readable on a light theme #275

Closed buffet closed 3 years ago

buffet commented 4 years ago

On several light themes, like Solarized Light (the one I'm using) the dependency name get printed white on white, and it not (or very poorly) readable at all.

This makes commands like niv show really hard to read.

nmattia commented 4 years ago

Ah damn! Do you have any idea what other tools do to figure out if something's readable or not?

EDIT: for instance jq?

buffet commented 4 years ago

I don't see jq print anything in white. It prints null in bold black (\x1b[1;30m), however it apparently also does this in a dark theme (using alacritty's default to test, and it's just invisible).

In general I'd just avoid using white and black in the output.

piegamesde commented 3 years ago

Sadly, there is no one-size-fits-all solution to this problem. To do it properly, I don't think you'll get around implementing basic color theme support. You could try to have a light and dark mode and make them work on as many backgrounds as possible. The easiest option is to provide an option that disables coloring entirely.

I'll use some generic stackoverflow answer as a workaround for now: niv show | sed -r "s/\x1B\[([0-9]{1,3}(;[0-9]{1,2})?)?[mGK]//g"