- From: Blake Gearin via GitHub <sysbot+gh@w3.org>
- Date: Sun, 24 Jul 2022 23:04:37 +0000
- To: public-fxtf-archive@w3.org
blakegearin has just created a new issue for https://github.com/w3c/fxtf-drafts: == [filter-effects] SVG filter for invert not working properly == Hello, I noticed that the [SVG filter for `invert`](https://www.w3.org/TR/filter-effects-1/#invertEquivalent) does not appear to be working properly. ```html <feComponentTransfer> <feFuncR type="table" tableValues="[amount] (1 - [amount])"/> <feFuncG type="table" tableValues="[amount] (1 - [amount])"/> <feFuncB type="table" tableValues="[amount] (1 - [amount])"/> </feComponentTransfer> ``` An amount of `0.5` appears over-lighten. Unless I'm mistaken that an `amount` of `0.5` is equivalent to a CSS filter's `50%`...? I found that using `feFuncA` instead of `feFuncR`, `feFuncG`, and `feFuncB` appears to work correctly. ```html <feComponentTransfer> <feFuncA type="table" tableValues="[amount] (1 - [amount])"/> </feComponentTransfer> ``` Comparison: ```html <p>Original Color</p> <div style=""></div> <p>CSS filter invert</p> <div class="base"></div> <p>SVG filter invert on W3</p> <div class="base" style="filter: url(#w3-invert)"></div> <p>SVG filter invert with feFuncR</p> <div class="base" style="filter: url(#feFuncR-invert)"></div> <svg> <filter id="w3-invert"> <feComponentTransfer> <feFuncR type="table" tableValues=".5 .5"/> <feFuncG type="table" tableValues=".5 .5"/> <feFuncB type="table" tableValues=".5 .5"/> </feComponentTransfer> </filter> </svg> <svg> <filter id="feFuncR-invert"> <feComponentTransfer> <feFuncA type="table" tableValues=".5 .5"/> </feComponentTransfer> </filter> </svg> <style> .base { height: 100px; width: 100px; background-color: #000000; } </style> ``` Image preview: <img width="228" alt="image" src="https://user-images.githubusercontent.com/17950836/180668956-abb7e76c-8388-4bd8-88e2-81374ac57f88.png"> Please view or discuss this issue at https://github.com/w3c/fxtf-drafts/issues/462 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Sunday, 24 July 2022 23:04:39 UTC