【问题标题】:Trying to get white drop shadow of dark SVG Image试图获得深色 SVG 图像的白色阴影
【发布时间】:2018-05-31 08:50:45
【问题描述】:

我正在尝试放置具有阴影的 svg 图像。我的主页背景颜色很暗。所以我想要一个深色 svg 对象的白色阴影。 这可能吗??

the svg image looks like this.

【问题讨论】:

    标签: svg svg-filters dropshadow


    【解决方案1】:

    是的,您可以在将其合成到源图形下之前将其重新着色为白色。像这样:

    <feGaussianBlur id="blur" in="SourceAlpha" stdDeviation="4"/>
    <feColorMatrix id="recolor"  type="matrix" values="0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0" result="white-glow"/>
    
    <!-- Merge the shadow with the original --> 
    <feMerge> 
      <feMergeNode in="white-glow"/> 
      <feMergeNode in="SourceGraphic"/> 
    </feMerge> 
    </filter>
    

    【讨论】:

    • 谢谢!!这对颜色很有用。我注意到笔触也变得模糊(我的意思是矢量线被像素化了)......是否可以保持笔触线清晰并在其后面添加阴影??
    • 不要编辑您的原始问题 - 这次发布另一个问题作为源代码的后续问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-12-19
    • 2015-07-14
    • 1970-01-01
    • 2019-04-20
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多