I am currently using an SVG gradient to apply a fade-out effect to patches.
This allows you to start the path with 100% opacity at x0 and gradually reduce the opacity to 0% at x1 , wherever they are for the particular path to which the gradient is applied:
<linearGradient id="gradient_to_transparent" x1="0%" x2="100%"> <stop offset="0" stop-opacity="1"></stop> <stop offset="1" stop-opacity="0"></stop> </linearGradient> This works great when applied to the outline stroke style:
<path d="..." style="stroke:url(#gradient_to_transparent);"></path> However, the problem is that when using this stroke style, I cannot additionally apply other stroke styles, and by default they remain black.
I would like the stroke style to be performed using any color I specify, and then apply a gradient to the stroke opacity or apply an SVG filter to create a fade-out effect.
I tried using SVG - feComponentTransfer with feFuncA , but could not get what would work.
The stroke color must be calculated separately for each path. Thus, the solution to set the color in the gradient will not scale.
Translation of the answer: using an SVG filter @drarmstr
