effects/invert: Add a color-preserving brightness inversion shader.
The currently existing screen inversion effect simply inverts each of the RGB channels by doing:
out = 1 - in
This MR adds an option to additionally rotate the color hue by 180°, which has the effect of keeping the original color value, while the brightness is still reversed.
The math for this has been worked out by Vasili Novikov in the following repository: https://github.com/vn971/linux-color-inversion/blob/master/shift.glsl
Inverted window, without these changes:
Inverted window, with these changes:
Note that while colors can be now preserved, the contrast is changed due to how particular colors are perceived. For example, look at the terminal screenshot, where the green and yellow text becomes hardly readable against a white background. This is one of reasons this should be a toggle.
I am not happy with binding the toggle action to Ctrl+Meta+O key shortcut. I would rather it be a checkbox in the effect settings window, but making this work is beyond what I am able to do.