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

Option for more compact display of multiple colors. #137

Open
sullyj3 opened this issue Apr 20, 2021 · 3 comments · May be fixed by #185
Open

Option for more compact display of multiple colors. #137

sullyj3 opened this issue Apr 20, 2021 · 3 comments · May be fixed by #185
Labels
enhancement New feature or request

Comments

@sullyj3
Copy link

sullyj3 commented Apr 20, 2021

First of all, this is a fantastic project, thanks for creating it!

Often when displaying multiple colors, it's desirable to be able to compare them side by side! Unfortunately, by default the color subcommand takes up a lot of vertical space, making it difficult to compare earlier and later colors, and inserts gaps and text, distancing them.

It would be cool to have some kind of flag or subcommand to display the color squares side by side, with minimal text. I'm imagining something along the lines of

pastel color --compact < lotsOfColors.txt

or

pastel compare < lotsOfColors.txt

This feature would be particularly useful for creating color palettes and themes, both interactively and programmatically.

@sharkdp
Copy link
Owner

sharkdp commented May 9, 2021

Thank you for reporting this. I agree that this would be useful.

A related feature would be #21. Would that also work for your use case?

@sullyj3
Copy link
Author

sullyj3 commented Nov 11, 2021

Partially, but #21 that still seems like its for comparing only two colors at once pairwise, rather than many. Consider the following example:

> cat 1.json
{
   "Razzmic Berry":"8a4f7d",
   "Rocket Metallic":"887880",
   "Rocket Metallic 2":"887f84",
   "Taupe Gray":"888587",
   "Battleship Grey":"888c8b",
   "Morning Blue":"88938f",
   "Morning Blue 2":"889992",
   "Morning Blue 3":"88a096",
   "Khaki Web":"bbab8b",
   "Salmon":"ef8275"
}
> jq -r 'values[]' 1.json|pastel color

The second command results in about a screen and a half of output. Whereas it would be nice to be able to compare them all at once without scrolling, perhaps as vertical stripes.

@sullyj3
Copy link
Author

sullyj3 commented Nov 11, 2021

Ah, I just noticed the script you demonstrated in #139, pastel paint looks like a nice solution.

for COLOR in $(jq -r 'values[]' 1.json); do pastel paint $(pastel textcolor $COLOR) --on $COLOR "$COLOR          "; done

Although it would be handy and ergonomic to have something like that built in, so as not to have to remember where I saved the script.

@sharkdp sharkdp added the enhancement New feature or request label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants