Hi all!
I just wanted to share with the community a color filter for the Color Filter plugin in Compiz that I had thought of and made, by looking at the sample filters. I used to love the negative plugin, which inverts the colors of the screen. I use it in the nighttime when the screen is just too bright for reading text or for coding. I prefer white text on a black background and maybe that's just me. But for those of you use the Negative plugin for the same reason as I do, read on!
What I don't like about the Negative plugin is that it also inverts the colors and it makes it hard to recognize some icons, such is the status icons in your IM client (green for online, red for busy, etc). So I've made a plugin for the Color Filter plugin (not the Negative plugin) which inverts black and white but keeps the original color. Here is the code for the filter:
Code:
!!ARBfp1.0
TEMP temp, neg, red, green, blue;
TEX temp, fragment.texcoord[0], texture[0], RECT;
RCP neg.a, temp.a;
MAD temp.rgb, -neg.a , temp, 1.0;
MUL temp, temp.a, temp;
ADD green, temp.r, temp.b;
ADD red, temp.g, temp.b;
ADD blue, temp.r, temp.g;
MUL red, red, 0.5;
MUL green, green, 0.5;
MUL blue, blue, 0.5;
MOV temp.r, red;
MOV temp.b, blue;
MOV temp.g, green;
MUL temp, fragment.color, temp;
MOV result.color, temp;
END
To use this, run the following commands:
Code:
cd /usr/share/compiz/filters/
sudo gedit nightmode
Copy and paste the code for the filter into the text editor, save it and close it.
Now open ccsm (CompizConfig Settings Manager) and turn on the Color Filter. Set your preferred keybindings and click New. Find the filter file in /usr/share/compiz/filters.
That's it.
I have attached a screenshot of the result.
Please comment and tell me what you think and if you have better code to get the same result, let me know! After all, I didn't know what I was coding. It was trial-and-error and took me about 50 minutes to get this.
Bookmarks