2021年1月22日星期五

SVG Filters Turn Off My CSS Filters. Why?

Stepping through my page, this line of code turns off my SVG Filter:

if (document.getElementById("cPreview") != null) document.getElementById("cPreview").style.filter =  "brightness(" + parseInt(percentB) + "%)" + " contrast(" + parseInt(percentC) + "%)" +  " saturate(" + parseInt(percentS) + "%)";    

If I add SVG code to that, my CSS Filters are turned off:

if (document.getElementById("cPreview") != null) document.getElementById("cPreview").style.filter = svgCOLOR + "brightness(" + parseInt(percentB) + "%)" + " contrast(" + parseInt(percentC) + "%)" +  " saturate(" + parseInt(percentS) + "%)";    

How do I code that so the SVG Filter and the CSS Filters play nicely together?

Thank you

https://stackoverflow.com/questions/65854759/svg-filters-turn-off-my-css-filters-why January 23, 2021 at 09:06AM

没有评论:

发表评论