kurkle / chartjs-plugin-gradient

Easy gradients for Chart.js
MIT License
33 stars 6 forks source link

Uncaught DOMException: CanvasGradient.addColorStop: Invalid color #20

Closed stockiNail closed 2 years ago

stockiNail commented 2 years ago

If you define in the color stop a non-color value, you get the following message:

Uncaught DOMException: CanvasGradient.addColorStop: Invalid color

Because the plugin is leveraging on @kurle/color, I would suggest to check if the color is valid before adding to the gradient, and, if not valid, skips it. I'm sorry but I didn't find the error before the last version release.

I'm going to submit a PR to fix it.

kurkle commented 2 years ago

Good, the last release did not run the action needed for npm release :)

stockiNail commented 2 years ago

FINE!! so we have time to fix it. I need some minutes....