connectome-neuprint / neuPrintExplorer

View connectomic data stored in neuPrint
Other
24 stars 4 forks source link

Cycle through hues when choosing new neuron colors #293

Open hubbardp opened 4 years ago

hubbardp commented 4 years ago

It is common that I repeat the pattern of submitting a query, choosing a neuron from the result, displaying that neuron, then submitting another query to display another neuron, etc. When I do so, the displayed neurons often have colors that are quite similar (e.g., half have various shades of purple while the other half have various shades of green). It is difficult to distinguish neurons that have such similar colors.

While no algorithm for automatically picking colors will be perfect, it should be possible to do better. For example, if the algorithm simply cycled through the colors of the rainbow (i.e., a red, an orange, a yellow, a green, a blue, an indigo, a violet), then at least I would get highly distinguishable colors for seven neurons.

This idea amounts to cycling through the hue part of a hue-saturation-value (HSV) color representation, where hue can be thought of as degrees on a circle. A concern is what happens when wrapping around on the circle of hues. One idea is to choose the increment used between hues so the wrapping is somewhat offset. Another idea is to start adjusting saturation or value when wrapping around.

neomorphic commented 4 years ago

The algorithm does cycle through the hue part of the hsl color space. Ultimately this suggests that it is not doing a very good job at picking a random value, if green and purple are picked more frequently than other colors.