How to Invert a White image to Black using SVG Filters?

前端 未结 1 493
没有蜡笔的小新
没有蜡笔的小新 2020-12-17 20:48

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 appl

相关标签:
1条回答
  • 2020-12-17 20:56

    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

    0 讨论(0)
提交回复
热议问题