-
Notifications
You must be signed in to change notification settings - Fork 403
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
Maximize color difference #50
Maximize color difference #50
Comments
No, not yet. This is number 1 on the to-do list. I'd be happy to hear your ideas! |
Hmm, this might take a bit more understanding of color spaces, but my naive solution would be picking a random starting color, and then solving the next point that's furthest away within the 3D search space (from which some regions would be excluded, as we don't want the murky browns etc). Then repeat for as many points as you need. Sounds like an O(n) algorithm, but I'd have to better understand how to avoid the murky regions etc. Will be watching this space. ;) |
What could work well would be to convert the colour to HSL, then split the 360º of hue to get the number of colours desired. Here's a pretty kludgy implementation: https://jsfiddle.net/32obz8jd/ (hit "Run" to get new colours) I use something similar on my website to adjust the luminosity of the random colour for the menu. |
Hi, There is a lot of interesting research on the "color perception" and "how to generate easily distinguishable set of colors":
It boils down to: RGB (even HSV) does not suitably model human color-perception; for smaller sets, it's best to use man-made (=evaluated) fixed
You can try a nice working solution at: http://phrogz.net/css/distinct-colors.html |
+1 |
1 similar comment
+1 |
You might want to check chroma-js |
I just closed #87. Here's why:
Here's one way to implement this feature:
Afterwards, we could then sort the generated colors to make neighbors as distinct as possible. |
+1 |
Merged #106, closing this for now |
@davidmerfield : Are there any news? |
This looks exactly like a lib that I'd soon need!
I see there's an option for providing a seed for having deterministic results, but is there any way of specifying "I want 5 colors (with these settings) that are as different from each other as possible"? So that if I ask for 3 colors, I won't get 3 different shades of red.
The text was updated successfully, but these errors were encountered: