【发布时间】:2018-04-20 08:27:44
【问题描述】:
我使用下面的radialGradient来给出一个灯泡发光效果:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="100%" height="100%"
viewBox="0 0 100 100">
<radialGradient id="radial" cx="50" cy="50" r="50"
gradientUnits="userSpaceOnUse">
<stop offset="0.8" style="stop-color:#00FFFF"/>
<stop offset="1" style="stop-color:#004444"/>
</radialGradient>
<circle cx="50" cy="50" r="50"
fill="url(#radial)"/>
</svg>
但是对于 Rectangular 和 Path Gradient 或任何 Custom Shape Gradient ,我该如何做同样的事情呢?
我们在 MS PowerPoint 中有这个选项,称为矩形渐变和路径渐变。
它从中心开始,每个边缘线的第一个停止点 0.8 和第二个停止点 1,就像上面的效果一样。
这些渐变在 Illustrator 中可用吗?
【问题讨论】:
-
SVG 不支持这种渐变。
-
您可以尝试使用阴影来伪造它。看看这个:stackoverflow.com/questions/20778568/…
-
@Austin 我整个晚上都在你的链接中尝试了所有组合。没有什么能产生这样的效果。我已经编辑了我的帖子
标签: svg path gradient shape effect