如何使用SVG过滤器将白色图像转换为黑色? [英] How to Invert a White image to Black using SVG Filters?

查看:202
本文介绍了如何使用SVG过滤器将白色图像转换为黑色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一种方法可以使用SVG过滤器将白色图像转换为黑色。

Is there a way to invert a white image to black using SVG filters?

在CSS过滤器中,我们 -webkit-filter: invert(1); 在IE10中不工作。我应用SVG过滤器作为后备。任何人都可以帮助?

In CSS Filter, we do -webkit-filter:invert(1); which does not work in IE10. I am applying SVG filters as fallback. Any one can help?

推荐答案

您可以使用SVG筛选器反转:

You can invert using an SVG Filter:

<feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 
                                                              0 -1 0 0 1 
                                                              0 0 -1 0 1
                                                              0 0 0 1 0"/>

有关详细信息,请参阅 feColorMatrix at webplatform.org

For more detail see the docs on feColorMatrix at webplatform.org

这篇关于如何使用SVG过滤器将白色图像转换为黑色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆