The Wayback Machine - https://web.archive.org/web/20201206200706/https://github.com/sharkdp/pastel/issues/121
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pastel pick doesn't display all colors #121

Open
nycex opened this issue Apr 5, 2020 · 4 comments
Open

pastel pick doesn't display all colors #121

nycex opened this issue Apr 5, 2020 · 4 comments

Comments

@nycex
Copy link

@nycex nycex commented Apr 5, 2020

When I run pastel pick in st or urxvt, i get a output like output_image
even though when running this:

awk 'BEGIN{
    s="/\\/\\/\\/\\/\\"; s=s s s s s s s s;
    for (colnum = 0; colnum<77; colnum++) {
        r = 255-(colnum*255/76);
        g = (colnum*510/76);
        b = (colnum*255/76);
        if (g>255) g = 510-g;
        printf "\033[48;2;%d;%d;%dm", r,g,b;
        printf "\033[38;2;%d;%d;%dm", 255-r,255-g,255-b;
        printf "%s\033[0m", substr(s,colnum+1,1);
    }
    printf "\n";
}'

from https://gist.github.com/XVilka/8346728, I get a smooth gradient:
gradient_image
In alacritty, it seems to work though:
alacritty_output_image

@sharkdp
Copy link
Owner

@sharkdp sharkdp commented Apr 5, 2020

It appears that urxvt does not set the COLORTERM variable to truecolor, which is the only way how we can detect that a terminal emulator supports 24bit colors.

If you run pastel colorcheck, you should be able to clearly determine whether or 24bit is supported.

@sharkdp
Copy link
Owner

@sharkdp sharkdp commented Apr 5, 2020

Don't you see a warning in the top output of pastel pick?

image

@nycex
Copy link
Author

@nycex nycex commented Apr 5, 2020

Well, I saw the warning and set the environment variable PASTEL_COLOR_MODE=24bit. With this enabled, I get the output in st and urxvt I showed earlier. But now that I tried, when I set COLORTERM=24bit or COLORTERM=truecolor, then it shows correctly all the colors like in alacritty. Maybe there is a problem with the check for PASTEL_COLOR_MODE

Edit: Btw it just works for st, I just looked into it and urxvt doesn't even support truecolor to my surprise.

@sharkdp
Copy link
Owner

@sharkdp sharkdp commented Apr 5, 2020

Maybe there is a problem with the check for PASTEL_COLOR_MODE

It looks like there is, yes. I can reproduce it. Thank you for reporting this!

(Unrelated: in general, I suggest using a terminal which properly sets COLORTERM. This will also enable true color support in many other programs).

@sharkdp sharkdp added the bug label Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.