Open illtellyoulater opened 1 year ago
It has been a long time since I looked at the code in this library. I honestly don't know, sorry.
Ok no worries I found another solution, but perhaps if you leave this open maybe someone else will be able to answer to this one day :)
something with a trailing semi colon like gradient.parse('linear-gradient(rgb(22, 234, 174) 0%, rgb(126, 32, 207) 100%);')
will cause this error whereas gradient.parse('linear-gradient(rgb(22, 234, 174) 0%, rgb(126, 32, 207) 100%)')
is fine
That sounds like an easy fix then. I'm open to accept any PR you might want to send to fix this.
I saw the code for this parser posted on Stack Overflow (https://stackoverflow.com/a/58071223/988591) and I thought about just copying it in the console window... No errors were thrown and I went ahead and ran:
GradientParser.parse(some_elem.style);
but I am getting this...
does it mean it can't run client side in the browser or am I doing something wrong?
I'm looking for a way to parse a linear-gradient in JS, client side... can't believe it seems almost impossible...