Adding invert patch

This commit is contained in:
bakkeby 2020-03-29 15:38:16 +02:00
parent 4966f31256
commit d26b46ffa7
8 changed files with 62 additions and 0 deletions

21
patch/invert.c Normal file
View file

@ -0,0 +1,21 @@
static int invertcolors = 0;
void
invert(const Arg *dummy)
{
invertcolors = !invertcolors;
redraw();
}
Color
invertedcolor(Color *clr)
{
XRenderColor rc;
Color inverted;
rc.red = ~clr->color.red;
rc.green = ~clr->color.green;
rc.blue = ~clr->color.blue;
rc.alpha = clr->color.alpha;
XftColorAllocValue(xw.dpy, xw.vis, xw.cmap, &rc, &inverted);
return inverted;
}

1
patch/invert.h Normal file
View file

@ -0,0 +1 @@
static void invert(const Arg *);

View file

@ -11,6 +11,9 @@
#if FONT2_PATCH
#include "font2.c"
#endif
#if INVERT_PATCH
#include "invert.c"
#endif
#if KEYBOARDSELECT_PATCH
#include "keyboardselect_x.c"
#endif

View file

@ -8,6 +8,9 @@
#if FONT2_PATCH
#include "font2.h"
#endif
#if INVERT_PATCH
#include "invert.h"
#endif
#if KEYBOARDSELECT_PATCH
#include "keyboardselect_x.h"
#endif