How to Invert a White image to Black using SVG Fil

2019-02-12 16:49发布

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

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?

1条回答
淡お忘
2楼-- · 2019-02-12 17:46

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"/>

For more detail see the docs on feColorMatrix at MDN

查看更多
登录 后发表回答