I am playing around with SVG filters, and there is a problem I have thought about for a long time. I am trying to change the colors of my SVG images (which contain base64 png strings) using filters. It is working well for most objects, but as soon as the object is very dark I get into trouble. See the example below where I am trying to apply a red color filter on an object that is very dark. The dark parts still remain the same dark, but I would like for it to change color to the same red as the background.
Is there any way / formula to apply filters that take into account the darkness of the original object color?
My thoughts so far is to detect the colours in an object and apply fill
instead filter
if the object is "dark enough", but I really don't like that solution.