There was an issue with getColor. If no radius was chosen, getCanvasPixelColor works fine. However, should a radius be chosen then calcAverageColor was not reporting back the correct colour.
I have changed the functions getCanvasBlockColors and calcAverageColor so that the correct colour returns.
I also have added an onChange event to the hook. This should complete the hook being 100% useable.
So far, I have only re-tested the example. This works fine. But I'd appreciate an npm push and then I will be able to confirm myself. Maybe an html example should be created as well?
Finally, I have amended the npm start method in the example, so that it works node 16+.
There was an issue with getColor. If no radius was chosen, getCanvasPixelColor works fine. However, should a radius be chosen then calcAverageColor was not reporting back the correct colour.
I have changed the functions getCanvasBlockColors and calcAverageColor so that the correct colour returns.
I also have added an onChange event to the hook. This should complete the hook being 100% useable.
So far, I have only re-tested the example. This works fine. But I'd appreciate an npm push and then I will be able to confirm myself. Maybe an html example should be created as well?
Finally, I have amended the npm start method in the example, so that it works node 16+.