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.
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