Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
Recent releases have been pre-built using cross-compilers and this script and are downloadable below.
If you have found these packages useful, give me a shout out on twitter: @adammw
| function getDominantColor(aImg) { | |
| let canvas = document.createElement("canvas"); | |
| canvas.height = aImg.height; | |
| canvas.width = aImg.width; | |
| let context = canvas.getContext("2d"); | |
| context.drawImage(aImg, 0, 0); | |
| // keep track of how many times a color appears in the image | |
| let colorCount = {}; |