Addition of Invert Plus Hue functionality to the Invert effect plugin
Needs ReviewPublic

Authored by cuperino on Apr 9 2020, 7:44 AM.

Details

Reviewers
zzag
ahiemstra
Group Reviewers
KWin
Summary

People who use assistive technologies to invert screen colors usually use them for various reasons...

  • An attempt to get rid of the screen's brightness. Useful when bright colors cause headaches.
  • An attempt to add brightness. Bright backgrounds allow eyes to focus better.
  • To see details present in dark shades of similar colors without having to increase the display's brightness.
  • To compensate from using a dark theme in direct sunlight

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.

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:

  • Ctrl-Super-H runs a new Invert Plus Hue shader over the entire screen
  • Ctrl-Super-G adds the active window to the list of windows to be inverted with the Invert Plus Hue shader

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.

Test Plan

Existing tests related to effect plugins pass. Code was thoroughly tested before commits, all possible plugin state combinations work correctly.

Diff Detail

Repository
R108 KWin
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 24976
Build 24994: arc lint + arc unit
cuperino created this revision.Apr 9 2020, 7:44 AM
Restricted Application added a project: KWin. · View Herald TranscriptApr 9 2020, 7:44 AM
cuperino requested review of this revision.Apr 9 2020, 7:44 AM
ngraham edited reviewers, added: zzag, ahiemstra, KWin; removed: kwin.Apr 9 2020, 3:57 PM