I have a very simple path within a SVG.
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 61 57"
version="1.1" x="0px" y="0px">
<defs>
<style type="text/css"><![CDATA[
]]>
</style>
</defs>
<path id="pipe" d="
M8.0178,52.0035
L27.0178,52.0035
C42.4568,52.0035 55.0178,39.4425 55.0178,24.0035
L55.0178,8.0035
L43.0178,8.0035
L43.0178,24.0035
C43.0178,32.8255 35.8398,40.0035 27.0178,40.0035
L8.0178,40.0035
L8.0178,52.0035
Z">
</path>
</svg>
(Preview: https://i.stack.imgur.com/FfBRg.png)
What I'd like to achive is that I have 3 separate gradients or filling spaces:
- The first one is from the inner curve to the center of the bended tube (curve).
- The second one is the center area.
- The third one from the center area to the outer curve of the tube.
Alternatively I could also use a single gradient with multiple stop colors.
The following image illustrates the wanted result: https://i.stack.imgur.com/I4CNa.png In this case the rectangles I added illustrate the gradient that I want to use along the whole curve.
I did some research regarding advanced gradients in SVG but I was not able to understand how to apply them or if that is even necessary. I understand how to apply radial and linear gradients to rectangles or even to curves but that did not deliver the expected result.
I also found Can I apply a gradient along an SVG path? which creates a gradient in the tube from left to right (so to say) and I'd like it from top to bottom.
Do you guys have any ideas how to solve this?