我有一个黑白图像,我正在尝试用SVG滤镜重新着色。Safari的颜色看起来比Chrome要暗得多,有没有办法让Safari看起来更像chrome呢?
CSS代码如下所示
.container-teamMembers a.six img {
-webkit-filter: url(#duotone_bright_green);
-moz-filter: url(#duotone_bright_green);
-o-filter: url(#duotone_bright_green);
-ms-filter: url(#duotone_bright_green);
filter: url(#duotone_bright_green);
}SVG过滤器是
<svg xmlns="http://www.w3.org/2000/svg" class="svg-filters">
<filter id="duotone_bright_green">
<feColorMatrix type="matrix" result="grayscale" values="1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
0 0 0 1 0"></feColorMatrix>
<feComponentTransfer color-interpolation-filters="sRGB" result="duotone_blue_black">
<feFuncR type="table" tableValues="0.03137254902 0.74509803921"></feFuncR>
<feFuncG type="table" tableValues="0.007843137255 0.81568627451"></feFuncG>
<feFuncB type="table" tableValues="0.02352941176 0.0431372549"></feFuncB>
<feFuncA type="table" tableValues="0 1"></feFuncA>
</feComponentTransfer>
</filter>
</svg>谁能告诉我如何让Safari在Chrome上看起来更轻/更一致?
发布于 2019-05-08 09:00:37
这看起来似乎很愚蠢--但是将color-interpolation-filters="sRGB"移到filter元素而不是feComponentTransfer中- Safari在放入原语时似乎不会检查它。
下面是适用于我的过滤器。我在MacOS Mojave上运行Chrome73和Safari12.1,运行的是一台更老的Macbook Pro (2016)。
<svg xmlns="http://www.w3.org/2000/svg" class="svg-filters">
<filter id="duotone_bright_green" color-interpolation-filters="sRGB">
<feColorMatrix type="matrix" result="grayscale" values="1 0 0 0 0
1 0 0 0 0
1 0 0 0 0
0 0 0 1 0"></feColorMatrix>
<feComponentTransfer result="duotone_blue_black">
<feFuncR type="table" tableValues="0.03137254902 0.74509803921"></feFuncR>
<feFuncG type="table" tableValues="0.007843137255 0.81568627451"></feFuncG>
<feFuncB type="table" tableValues="0.02352941176 0.0431372549"></feFuncB>
<feFuncA type="table" tableValues="0 1"></feFuncA>
</feComponentTransfer>
</filter>
</svg>这是屏幕截图- Chrome左边,Safari右边。

https://stackoverflow.com/questions/56029986
复制相似问题