Closed AlexRMU closed 6 months ago
Are there currently colors that are not recognized, or values that are wrongly recognized as a color? Can you give a couple of examples?
It's more about performance
Is color recognition a performance bottleneck? If so I'm open to explore better alternatives for the isColor
function used right now, but otherwise let's close this issue.
No, it doesn't seem to be
👍
I've done a little experiment. When having a JSON document with a very large text, something like 100e6 bytes, it can take about half a second to determine whether it is a color. So I added a check for long text strings, see b1a04fc. I've also applied your idea to reuse the div
to test whether some string is a color, see 514f6ca. It seems to improve the performance a bit.
Improvements are published now in v0.21.2
.
👍