News for hackers. Stuff that matters.
Re:Show HN: I Made JavaScript Color Conversion Library for L... by chrismorgan on Friday May 22, 2020 @08:08AM (#23271221)
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

Re:Show HN: I Made JavaScript Color Conversion Library for L... by 07d046 on Friday May 22, 2020 @08:30AM (#23271357)
I 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.