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

Request: Add a second ordering criterium for pastel sort #136

Open
nkh opened this issue Mar 22, 2021 · 7 comments
Open

Request: Add a second ordering criterium for pastel sort #136

nkh opened this issue Mar 22, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@nkh
Copy link

nkh commented Mar 22, 2021

sorting color generate a large output which makes it difficult to compare the colors to each other, the possibility to sort colors and present them in one line would be very welcome

@sharkdp
Copy link
Owner

sharkdp commented Mar 27, 2021

You could use the -f (--force-color) mode in your last pastel call and pipe to xargs echo. For example:

pastel distinct 12 | pastel sort | pastel -f format hex | xargs echo

or:

pastel list | pastel sort-by hue | pastel -f format name | xargs echo

@nkh
Copy link
Author

nkh commented Mar 28, 2021

is there a way to sort by hue and luminosity?

@sharkdp
Copy link
Owner

sharkdp commented Mar 28, 2021

Yes. Check out pastel sort-by --help.

@nkh
Copy link
Author

nkh commented Mar 28, 2021

I did but I see nothing there that tell me how to sort by Hue AND Brightness, trying to give both is an error and piping the first in the second doesn't sort on both criteria.

sorting on Hue gives, ie: dimgray, gainsboro, gray, lightgray

@sharkdp
Copy link
Owner

sharkdp commented Apr 3, 2021

what does it mean to sort by "Hue AND Brightness"? Do you mean: Sort "by Hue, THEN by Brightness"? I.e.: For colors where the hue is exactly the same, sort by brightness?

@nkh
Copy link
Author

nkh commented Apr 3, 2021

an example explains better, if you look at the colors I listed in that order (given by sort-by hue) above do they look sorted to you?

@sharkdp
Copy link
Owner

sharkdp commented Apr 3, 2021

Well. These colors all have a hue of zero:

▶ pastel format hsl-hue dimgray gainsboro gray lightgray
0
0
0
0

I agree, they don't look sorted, as the brightness goes up and down. So indeed, it would be useful to have a second (lower priority) sort order for the sort subcommand. Let's turn this into a feature request 👍

@sharkdp sharkdp added the enhancement New feature or request label Apr 3, 2021
@sharkdp sharkdp changed the title request: sort list of colors Request: Add a second ordering criterium for pastel sort Apr 3, 2021
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

No branches or pull requests

2 participants