Good library to begin with, but could do better on the perceived brightness.<p>Since HSV is NOT perceived as evenly distributed to the human eye along the value(lightness) axis[1],<p>would recommend employing <i>chroma.js</i>[2] which uses the HCL and CIE color spaces, which in general yield more pleasing results for use in color scales.<p>[1] <a href="http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/" rel="nofollow">http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/</a><p>[2] <a href="https://github.com/gka/chroma.js" rel="nofollow">https://github.com/gka/chroma.js</a><p><i>i want hue</i> might be a bit of overkill though: <a href="http://tools.medialab.sciences-po.fr/iwanthue/index.php" rel="nofollow">http://tools.medialab.sciences-po.fr/iwanthue/index.php</a>
Maybe of interest: colorbrewer palettes as included in D3.js, which is my goto choice for colors<p><a href="http://bl.ocks.org/mbostock/5577023" rel="nofollow">http://bl.ocks.org/mbostock/5577023</a><p><a href="https://github.com/mbostock/d3/tree/master/lib/colorbrewer" rel="nofollow">https://github.com/mbostock/d3/tree/master/lib/colorbrewer</a>
A really important thing for data-vis is generating distinguishably different random colors. It'd be great to have a library that produces series of distinguishable, pleasing colors.
Related : "How to Generate Random Colors Programmatically"<p><a href="http://martin.ankerl.com/2009/12/09/how-to-create-random-colors-programmatically/" rel="nofollow">http://martin.ankerl.com/2009/12/09/how-to-create-random-col...</a>
I wrote a general purpose (pseudo-)random value generation library[0] that does random color generation[1] among lots of other capabilities. It'd be interesting to see how you could use the mutator to implement some of this functionality.<p>[0] <a href="https://github.com/heydenberk/stochator" rel="nofollow">https://github.com/heydenberk/stochator</a>
[1] <a href="https://github.com/heydenberk/stochator#from-predefined-sets" rel="nofollow">https://github.com/heydenberk/stochator#from-predefined-sets</a>
I went with the approach of hardcoding few sets generated by <a href="http://tools.medialab.sciences-po.fr/iwanthue/" rel="nofollow">http://tools.medialab.sciences-po.fr/iwanthue/</a> (which i think already been covered on HN) in my app. Just one set when i need <= 5 colors, one for <= 20, 50 and 100. Oh, and alternative set with different palette of colors when I need two diagrams on the same page. As a colorblind person I must say I was very happy with the results.
"BRIGHT COLORS" and "DARK COLORS" overlap with several dark colors. pretty much every color model gets brightness values that dont jive with perceptual reality.
This produces really nice colour sets, I'll definitely be using this to generate some backgrounds for blog posts. Nice work and thanks for sharing.
really like it. did some research before on how to generate colours that would be good for some simple visualizations, but found it difficult. This is great for a quick retrieval of colours that you can use!