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 format ansi-8bit not working for me #111

Closed
eggbean opened this issue Dec 2, 2019 · 1 comment
Closed

pastel format ansi-8bit not working for me #111

eggbean opened this issue Dec 2, 2019 · 1 comment

Comments

@eggbean
Copy link

eggbean commented Dec 2, 2019

Nice colour tool.

I have PASTEL_COLOR_MODE=8bit set, as I appear to be using an 8-bit terminal, so I cannot properly see the whole range of the output from pastel list.

What I would like to use this for is looking for terminal colours to use in theming things like tmux. But this is not giving any output:

pastel random -n 20 | pastel format ansi-8bit
pastel color cornflowerblue | pastel format ansi-8bit

rgb format works fine.

@sharkdp
Copy link
Owner

sharkdp commented Dec 4, 2019

Thank you for the feedback!

I guess it works, but you don't see the output, because it will output an ANSI escape code. Output something else in addition, and you should see the colors appearing:

printf "$(pastel format ansi-8bit cornflowerblue)TEST\x1b[0m\n"
printf "$(pastel random -n1 | pastel format ansi-8bit)TEST\x1b[0m\n"

If you want a nicer API, you can also take a look at the pastel paint subcommand:

pastel paint cornflowerblue TEST
pastel paint black --on cornflowerblue TEST
pastel random -n1 | pastel paint - TEST
pastel random | xargs -I{color} pastel paint {color} Test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants