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

Broken distinguishable_colors #16

Closed
axsk opened this issue Sep 16, 2015 · 6 comments
Closed

Broken distinguishable_colors #16

axsk opened this issue Sep 16, 2015 · 6 comments

Comments

@axsk
Copy link

axsk commented Sep 16, 2015

When allowing for high luminances it produces undistinguishable colors :(

using Colors
Colors.distinguishable_colors(8, lchoices=linspace(0, 255, 5))

image

In comparison the behaviour from the old Color.jl package.

using Color
Color.distinguishable_colors(8, lchoices=linspace(0, 255, 5))

image

Happens with both, Colors release and master.

@axsk
Copy link
Author

axsk commented Sep 16, 2015

Reading further I realized that in LCH the luminance is defined to be in [0,100],
so I screwed this up :/
Comparing again Colors.distinguishable_colors(8)
image
with Color.distinguishable_colors(8)
image
made me wonder though why yellow is skipped in favour of a third blue (I don't find 5 and 8 so easy to distinguish :/) in the new version...

Well, it's not broken so feel free to close this.

@axsk
Copy link
Author

axsk commented Sep 16, 2015

Oh, would we maybe have some space for fixed color palettes like these?

@timholy
Copy link
Member

timholy commented Sep 16, 2015

The difference between the old and new is that it performs the computations in LCHab space in the new one; it constantly converts between RGB and LCHab in the old one. There could, of course, be a bug; you could @show the color differences between candidates you like and the ones it chooses, if you feel like diving into this.

@timholy timholy closed this as completed Sep 16, 2015
@timholy
Copy link
Member

timholy commented Sep 16, 2015

I'd be fine with having some fixed palettes. There's a ColorBrewer package already, interestingly. Not really my expertise, so others should chime in.

@axsk
Copy link
Author

axsk commented Sep 16, 2015

Correct me if I'm wrong, but increasing the desired number of colors just adds new colors to the palette and doesn't change the already obtained. I wonder if it possible to obtain the really maximally distinguishable colors this way. Shouldn't I have to move all colors when adding a new one?

The simple picture in my head is that of a circle. When choosing n points with maximal distance I divide it into equally large sectors, but this requires changing multiple points when increasing n.

@timholy
Copy link
Member

timholy commented Sep 17, 2015

Correct. This package produces the nth distinguishable color as the one "farthest" from the first n-1. It does not reconsider the first n-1 in light of the chosen value for the nth.

Another algorithm would, of course, make a fine contribution. Would be interesting to compare performance.

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