I am attempting to replicate the CSS styling I have already implemented for a class on an SVG element.
In CSS, the fill property inherits the current color of the parent element, let's say it's red for argument's sake.
Next, I add several linear gradients with different opacity values and apply various background blend modes to each gradient.
This setup works perfectly for the CSS class.
Now, what I have tried so far for the SVG is as follows:
<svg class="shape" width="100%" height="100vh" preserveAspectRatio="none" viewBox="0 0 1440 800" xmlns:pathdata="http://www.codrops.com/">
<!-- background-image:
linear-gradient(-180deg, rgba(black,0.69) 0%, rgba(black,0.69) 100%),
linear-gradient(-180deg, rgba(black,0.100) 0%, rgba(black,0.100) 100%),
linear-gradient(-180deg, rgba(black,0.49) 0%, rgba(black,0.49) 100%);
background-blend-mode: luminosity, lighten, saturation; -->
<defs>
<filter id="f1" x="0" y="0" width="100%" height="100%">
<feFlood x="0" y="0" width="100%" height="100%" flood-color="black" flood-opacity="0.69" result="lumiFill"/>
<feBlend in="SourceGraphic" in2="lumiFill" mode="luminosity" result="lumiBlend"/>
<feFlood x="0" y="0" width="100%" height="100%" flood-color="black" flood-opacity="0.1" result="lightenFill"/>
<feBlend in="lumiBlend" in2="lightenFill" mode="lighten" result="lightenBlend"/>
<feFlood x="0" y="0" width="100%" height="100%" flood-color="black" flood-opacity="0.49" result="saturationFill"/>
<feBlend in="lightenBlend" in2="saturationFill" mode="saturation" result="saturationBlend"/>
</filter>
</defs>
<rect width="300" height="100" filter="url(#f1)" />
</svg>
Although this does seem to change the color, I suspect it may be stopping at the first flood because when I remove the other two floods, it works fine.
Could someone please suggest what I might be doing wrong?