xrandr-invert-colors icon indicating copy to clipboard operation
xrandr-invert-colors copied to clipboard

Invert intensity but leave green/red as-is

Open gregorlarson opened this issue 7 years ago • 5 comments

I use xrandr-invert-colors to reduce eye-strain at work. One of the things I do is review code-changes (diffs). Code-changes are often presented in color, with red indicating deleted lines, and green indicating added lines. I can fix the colors in xfce or gnome terminal to make green and red show correctly when inverted (i.e. for git diff, colordiff, vim-diff etc.). Problem: If it am viewing code diffs on a web-based tool (with firefox) it becomes more difficult to map colors. I can try stylish or user-scripts but these end of being difficult to maintain. Also, gui-tools like CLion, Eclipse etc also display code-diffs in color, and are more difficult to configure. Ideally, I would like a setting on xrandr-invert-colors which somehow inverts intensity (so I can browse with a dark background) but keeps green and red unchanged. Not sure this is even a sensible thing to do, but I wanted to get your opinion on if it would be possible. Thanks!

gregorlarson avatar Oct 21 '17 15:10 gregorlarson

https://github.com/zoltanp/xrandr-invert-colors/issues/7 https://github.com/vn971/linux-color-inversion so, one could either hack on the X server, or suffer a compositing wm, or find/build a solution based on wayland

koo5 avatar Oct 22 '17 13:10 koo5

Just to elaborate a little bit:

In order to change only some colors, and not all of them, it would be needed to process the whole set of (R,G,B) color of a pixel; xrandr-invert-colors uses the RGB ramps for inverting colors, which means that it can only transform R, G, B values independently. Thus it is unable to distinguish between a white pixel (R=255,G=255,B=255) and a green one (R=0, G=255, B=0).

With compositors this color transformation should be possible; the links given by koo5 are nice.

zoltanp avatar Oct 23 '17 07:10 zoltanp

im becoming convinced that one just gets used to it eventually (to the red/green in diffs)

koo5 avatar Nov 08 '17 15:11 koo5

im becoming convinced that one just gets used to it eventually

I've been using it a long time now, and I'm still not convinced.

Looking for a solution

otto-dev avatar Aug 29 '19 19:08 otto-dev

apparently, gnome-shell is your friend now: https://github.com/DisplayLink/evdi/issues/44#issuecomment-1031713341

koo5 avatar Feb 10 '22 19:02 koo5