-
Notifications
You must be signed in to change notification settings - Fork 25
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
Some blacks are not correctly ordered when ordering by color #66
Comments
Might this be something we can calculate ourselves by turning the Hex into HSL, and ordering primarily by Hue but then by either Saturation / Brightness to suit our needs? I imagine that's what a lot of color-sorter is, but may allow us greater flexibility if it's built straight into our own code? |
Feel free to play around with it, you can inspect the source code of Honestly, as a temporary fix I would be okay if we hard-code moving |
I agree that there isn't a "best" solution, but that doesn't mean there necessarily isn't anything we can do. I think the goal of this issue to find what we, collectively, think is the "best" solution for our use case. To get to that I would suggest anyone working on this tries to play with the configuration of our current color sorter library, and possibly try some others libraries. That way we can see what "feels" right, and perhaps narrow down on aspects we find important (e.g., the order should look "as expected" above the fold - which it currently doesn't). I will update the issue description for clarity |
I am scouring the web for alternative algorithms. They all have pretty visible trade offs, I'm afraid. The most promising approach I've found is hue clustering: order the colors in buckets by hue, order each bucket by luminosity, and concatenate the buckets. Can someone explaon why are we sorting by color, anyways? Is this a highly used feature, or does it provide an importanr benefit I'm missing? |
That's awesome, though I don't think we have to (or even should) go beyond using anything prebuilt that's available on npm. If you've come to the conclusion that there's really no suitable solution for the problem/example of the issue description than please do close this 🙂
I would personally prefer it the way we have now where it is (mostly) granular - with "pure" blacks and whites at the end.
The project website originally started out that way. Following #38 we decides to switch the default to alphabetical ordering. I personally still use the colored ordering as neither colored or alphabetical seems "usefull" to me, and colored ordering is more aesthetically pleasing. If there's consensus I guess we could remove it but, at least to me, it doesn't seem like too much trouble to keep around as long as we already have it. |
http://jorgeamadosoria.info/colorsorting/ a sample of ways to order by colors. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
If you think categories are a good idea, open an issue!
I understand where you're coming from from a technical perspective, but that doesn't translate clearly to displaying things on a website.
Forgot about that comment 😅 Nice work on that one! (here's a preview in case you ever decide to remove the webpage)
All in all, I don't think any of the alternatives is better than what we have currently. Thanks a lot for putting this together though! The only other avenue I can think of is trying to extract blacks and whites and sort the "colors" separately from the "grays" and then just append the "grays" after the "colors". I believe the previous version of our website used to do something like this based on the saturation(?). My knowledge of color theory is very limited, @jorgeamadosoria do you think you could investigate further in this direction? |
Yeah, I also don't think any of these is better than the current one. Maybe the buckets, but it has the issue of alternating dark to light per bucket, as you pointed out. Now, regarding blacks, whites and grey, I guess that it is possible to mdoify the bucket algorithm to add a black, a grey and a white buckets at the end of the algorithm. |
I've added a new approach: http://jorgeamadosoria.info/colorsorting/ Slightly better with the blacks and whites, but not perfect. Hey, at least the leading blacks are out of that position, so that's a win, I guess. |
I think this is heading in the right direction, if you reverse the black and whites (so the colors are followed by whites first, then blacks) it would be satisfactory for this issue. We could play around with the exact cutoffs for blacks and whites but this is a good start. Do you think you can replace the current implementation by yours? |
It should be easy to invert blacks and whites. they are in different buckets so it would just be a switch. I can try and substitute the implementation and make a PR we can test live, let's see how that looks like on the web site. |
Kind of issue
Description
When ordering by colour the ordering is a bit off as some black colors are displayed at the top, before the reds, while most blacks are displayed all the way at the bottom, following the whites.
Ideally, we find some sort of solution for this ordering problem. Unfortunately, in general there isn't necessarily a good solution for sorting colors. There will always be some cutoff point and it will probably never be perfect.
However, with some effort we may be able to improve the current situation. Two (possible) goals:
Anyone looking to work on this issue, share any suggestions, research, or previews you can 🙂
Example
Below is an example of what ordering by colour looks like - using v4.8.0 of simple-icons. As you can see "GitHub" and "DS Autombiles", which have dark grey colours, appear before "The Spriters Resource" which is red, i.e.
#181717
#1D1717
#BE3939
The text was updated successfully, but these errors were encountered: