Help with using a js library
hey! i need help using color.js (https://github.com/luukdv/color.js/) but i dont really know how to use libraries.
GitHub
GitHub - luukdv/color.js: Extract colors from an image (0.75 KB) 🎨
Extract colors from an image (0.75 KB) 🎨. Contribute to luukdv/color.js development by creating an account on GitHub.
6 Replies
https://codepen.io/CosyXD/pen/QWXwGqM?editors=1111 erm... why is this working on codepen but not on my system
this is on my pc ^ my functions are undefined i dont understand
![No description](https://cdn.answeroverflow.com/1260489257718648912/image.png)
show index.html:13
i don't think you need to load your index.js file with type module.
(codepen will work because the js differently loaded)
also, it is easier to load libraries in the head section
i would do this
if this doesn't solve it, please show your real js file (because the error is showing on a different line than in the codepen file), and maybe something else is causing the issue
![No description](https://cdn.answeroverflow.com/1260544256922091553/image.png)
yeah that did it!
ty
maybe it had something to do with the defer attribute you added
i'll look into that
thanks yall for helping out