2 ms·
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
by chrismorgan 6y ago
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 https://github.com/gka/chroma.js
[1]: https://bundlephobia.com/result?p=chroma-js https://bundlephobia.com/result?p=chroma-js
- 07d046 6y agoI don't know why it should be tiny, given what it's trying to do. Multiple kilobytes are dedicated to CSS color names and ColorBrewer scales, which don't compress well. At the end of the source there's a section where you can comment out lines which should remove sections of the code when compressing it.