aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeddy Wing2021-03-03 23:08:20 +0100
committerTeddy Wing2021-03-03 23:08:20 +0100
commit5f9699734c9e58552a58f2708fed925986158f61 (patch)
tree54616c46bb906562563b07a61f4247085d1eee76
downloadRe-Good-Catalina-Invert-Colours-5f9699734c9e58552a58f2708fed925986158f61.tar.bz2
Try inverting display colours
Invert the screen colours for as long as the program is active. Only works on the main display currently. Inspired by Nikolai Ruhe's (https://stackoverflow.com/users/104790/nikolai-ruhe) answer on Stack Overflow about screen colour inversion: https://stackoverflow.com/questions/14163788/how-does-on-screen-color-inversion-work-in-os-x/14165523#14165523 and this question: https://stackoverflow.com/questions/32823023/permanently-modifying-rgb-gamma-table
-rw-r--r--Makefile2
-rw-r--r--main.m19
2 files changed, 21 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b6b403c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,2 @@
+all:
+ clang -x objective-c -framework Coregraphics -o invert-catalina-invert main.m
diff --git a/main.m b/main.m
new file mode 100644
index 0000000..5cc0ad0
--- /dev/null
+++ b/main.m
@@ -0,0 +1,19 @@
+#import <CoreGraphics/CoreGraphics.h>
+
+int main(int argc, const char * argv[]) {
+ const CGGammaValue gamma[2] = {1, 0};
+ const CGGammaValue two[2] = {1, 0};
+ const CGGammaValue three[2] = {0, 1};
+
+ CGSetDisplayTransferByTable(
+ CGMainDisplayID(),
+ 2,
+ gamma,
+ gamma,
+ gamma
+ );
+
+ sleep(5);
+
+ return 0;
+}