wader/fq

Color output is unreadable on terminals using light backgrounds.

adedomin opened this issue · 4 comments

What version are you using (fq -v)?

$ fq -v
0.7.0 (linux amd64)

How was fq installed?

nix shell 'nixpkgs#fq'

Can you reproduce the problem using the latest release or master branch?

yes,

What did you do?

N/A

What result did you expect?

colors safe for both dark bg and light bgs or no colors at all (-M flag is satisfactory for now)

What did you see instead?

Screenshot_20230802_212351

wader commented

Hey! yes that does not look great. Do you have any other tool that uses color that work better? wonder if it's possible to come up with colors codes that work nice for both dark/bright background hmm.

I found this jq issue jqlang/jq#495 that might give some inspiration.

If you want to help out and experiment you can do something like:

# see "fq -h options" for default
$ fq -o colors="array=white,dumpaddr=yellow,dumpheader=yellow+underline,error=brightred,false=yellow,index=white,null=brightblack,number=cyan,object=white,objectkey=brightblue,prompt_repl_level=brightblack,prompt_value=white,string=green,true=yellow,value=white" -o byte_colors="0-255=brightwhite,0=brightblack,32-126:9-13=white" ...

Color names are defined here https://github.com/wader/fq/blob/master/pkg/interp/ansi.jq and you can add more if needed.

wader commented

What terminal and theme is this btw? trying to come up with a sane way to test things without to much effort. Something like this seems to work ok:

Screenshot 2023-08-03 at 11 37 09

wader commented

What about this?

Screenshot 2023-10-10 at 10 56 59

Generated with:

echo "Current"; fq . -o line_bytes=16 test.mp3 ; echo "New dark"; go run . -o line_bytes=16 -C . test.mp3; echo "New light"; go run . -o line_bytes=16 -C . test.mp3 | ansisvg -colorscheme "Builtin Solarized Light" | ffcat
wader commented

Fixed by #781