What does HackerNews think of chroma.js?

JavaScript library for all kinds of color manipulations

Language: JavaScript

This is the library the author references. I’ve used it myself and it works great

https://github.com/gka/chroma.js

Yeah, I was looking at chroma.js a day or two back and thinking “you call it ‘t̶i̶n̶y̶ small-ish’ [0]!? This thing is 40KB, 14KB gzipped [1], that’s by no means small!”

I’d expect such a library to be way smaller (I dunno, but less than 10KB/4KB), and preferably support tree-shaking so that I can just pick out the hcl() function, for example, if that’s all I want.

[0]: https://github.com/gka/chroma.js

[1]: https://bundlephobia.com/result?p=chroma-js

Good library to begin with, but could do better on the perceived brightness.

Since HSV is NOT perceived as evenly distributed to the human eye along the value(lightness) axis[1],

would recommend employing chroma.js[2] which uses the HCL and CIE color spaces, which in general yield more pleasing results for use in color scales.

[1] http://vis4.net/blog/posts/avoid-equidistant-hsv-colors/

[2] https://github.com/gka/chroma.js

i want hue might be a bit of overkill though: http://tools.medialab.sciences-po.fr/iwanthue/index.php