fury icon indicating copy to clipboard operation
fury copied to clipboard

Ability to specify from which colormap fury.colormap.distinguishable_colormap should draw

Open JulianoGianlupi opened this issue 4 years ago • 1 comments

Is your feature request related to a problem? Please describe.

Not exactly a problem. I really like distinguishable_colormap and I think it would be neat to be able to restrict the generation to an already established colormap, for instance: plasma. That way we can guarantee (or get closer to guaranteeing) that the colors are distinguishable by both people with and without colorblindness.

If there already is a way to do this great!

JulianoGianlupi avatar Aug 11 '21 16:08 JulianoGianlupi

@JulianoGianlupi thank you for your question. We currently do not have an implementation of a similar algorithm for established colormaps. The existing implementation is using the LAB colorspace to choose distinguishable colors. If you look at the code I think we could do the same so that every new selected color is as far as possible from the previously selected colors. Please look at the function https://github.com/fury-gl/fury/blob/fedfd68c776d9f0e1c3881995c077ba370fdfb1a/fury/colormap.py#L571 and try to adjust it to a standard colormap. This function here will give you the RGB values of the standard colormaps https://github.com/fury-gl/fury/blob/fedfd68c776d9f0e1c3881995c077ba370fdfb1a/fury/colormap.py#L301 You can then move these from RGB to LAB. That's one way to do this. I hope this information helps.

Garyfallidis avatar Aug 12 '21 00:08 Garyfallidis