<table><tr><td style="">cuperino created this revision.<br />cuperino added a reviewer: kwin.<br />Herald added a project: KWin.<br />cuperino requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D28695">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>People who use assistive technologies to invert screen colors usually use them for various reasons...</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">An attempt to get rid of the screen's brightness. Useful when bright colors cause headaches.</li>
<li class="remarkup-list-item">An attempt to add brightness. Bright backgrounds allow eyes to focus better.</li>
<li class="remarkup-list-item">To see details present in dark shades of similar colors without having to increase the display's brightness.</li>
<li class="remarkup-list-item">To compensate from using a dark theme in direct sunlight</li>
</ul>
<p>Some of these issues are addressed by the use of dark and light themes, but there are applications that don't yet or may never support both themes. These are some of the use cases where plugins such as KWin's Invert effect come in. Unfortunately, inverting colors comes with a disadvantage dark themes do not have. When inverting colors not only the brightness but the hue becomes opposite of the original image, giving an alien look to things and making them harder to recognize.</p>
<p>A solution to this problem is to displace the hue by 180 degrees before or after the color invert. This revision of the Invert plugin does that by adding two new keyboard shortcuts to the Invert plugin:</p>
<ul class="remarkup-list">
<li class="remarkup-list-item">Ctrl-Super-H runs a new Invert Plus Hue shader over the entire screen</li>
<li class="remarkup-list-item">Ctrl-Super-G adds the active window to the list of windows to be inverted with the Invert Plus Hue shader</li>
</ul>
<p>The logic behind the new feature is the same as the original Invert functionality, which uses Ctrl-Super-I and Ctrl-Super-U for a traditional invert. When the screen is inverted, windows in the list of windows to be inverted are treated as windows to not be inverted, thus preventing the same shader from being applied twice, wasting GPU cycles. This implementation takes this one step further, allowing the user to toggle between the classic Invert feature and the new Invert Plus Hue. When the user toggles between inverts, the previous invert is removed before the other sets in, preventing any invert shaders from being applied twice.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Existing tests related to effect plugins pass. Code was thoroughly tested before commits, all possible plugin state combinations work correctly.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D28695">https://phabricator.kde.org/D28695</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>effects/invert/data/1.10/invert-plus-hue.frag<br />
effects/invert/data/1.10/invert.frag<br />
effects/invert/data/1.40/invert-plus-hue.frag<br />
effects/invert/data/1.40/invert.frag<br />
effects/invert/invert.cpp<br />
effects/invert/invert.h<br />
effects/invert/invert_config.cpp<br />
effects/shaders.qrc</div></div></div><br /><div><strong>To: </strong>cuperino, kwin<br /><strong>Cc: </strong>cuperino, kwin, Orage, cacarry, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>