SVG 中的默认描边和填充
我对 SVG 中的描边和填充默认值感到困惑。
在 SVG 规范中 (http://www.w3.org/TR/SVG /painting.html#StrokeProperty)它说笔画属性的初始值是无 - 我猜这是透明的?默认描边宽度为 1。默认描边不透明度也应
为 1 类似的 filll (http://www.w3.org/TR/SVG/painting.html#FillProperty)默认应为黑色且不透明度为 1
Inkscape,并且浏览器似乎假定为笔划= 黑色并且填充是透明的 - 是这样吗?有谁知道默认值应该是什么?我渲染的 SVG 似乎与浏览器和 inkscape 显示的不一致......
Im confused about stroke and fill defaults in SVG.
in the SVG spec (http://www.w3.org/TR/SVG/painting.html#StrokeProperty) it says the initial value for the stroke property is none - which i am guessing is transparent? and the default stroke width is 1. and default stroke-opacity should be 1 too
Similarly for filll (http://www.w3.org/TR/SVG/painting.html#FillProperty) the default should be black and opacity 1
Inkscape, and browsers seems to assume stroke = black and fill is transparent though - is that right? Does any one know what the defaults should be? and my rendered SVG seems to be at odd whith what browser and inkscape show...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
stroke=none 意味着根本没有笔划,这与透明略有不同(笔画=<任何颜色> 与笔划不透明度=0 相结合就是我认为透明的)。
规范规定了填充和描边的默认值。到目前为止,我还没有看到任何 svg 查看器会犯这个错误。你有一个 svg 示例吗?
stroke=none means no stroke at all, which is slightly different from just being transparent (stroke=<any color> combined with stroke-opacity=0 is what I would consider transparent).
The spec says what the defaults are for fill and stroke. I haven't seen any svg viewer that gets that wrong so far. Do you have an example svg?