【发布时间】:2018-05-31 05:33:16
【问题描述】:
我正在制作两个渐变:一个在 objectBoundingBox 单元中,另一个在 userSpaceOnUse 中。这个想法是让它们看起来一样。但不知何故,它们是不同的。这是 svg 文件。
<svg width="500" height="500" viewBox="0 0 500 500" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<linearGradient id="user-grad" gradientUnits="userSpaceOnUse" x1="0" y1="0" x2="200" y2="100">
<stop stop-color="orange" offset="0"/>
<stop stop-color="blue" offset="1"/>
</linearGradient>
<linearGradient id="box-grad" x1="0" y1="0" x2="1" y2="1">
<stop stop-color="orange" offset="0"/>
<stop stop-color="blue" offset="1"/>
</linearGradient>
</defs>
<rect x="0" y="0" width="200" height="100" fill="url(#user-grad)"/>
<rect x="250" y="0" width="200" height="100" fill="url(#box-grad)"/>
</svg>
这是它的样子
它们看起来不应该一样吗?
【问题讨论】:
标签: svg linear-gradients