How do I invert the luminosity of the display using a color matrix or something else?

I recently came across a program that used data tables to invert the display, however it was a windows only application and I am wondering how I can write a similar thing for Mac, or if there is one already available. The app and config file is attached below so you can sort of dissect how it works

Config File: [negativescreen.conf](https://developer.apple.com/forums/content/attachment/f4b67ed7-fa71-4ee6-9c0d-18febe2c3381)

Readme file: [README.md](https://developer.apple.com/forums/content/attachment/86bd72f6-46c9-42d5-a925-561f75f24ae8)

Window$ Executable: [NegativeScreen.exe](https://developer.apple.com/forums/content/attachment/a4478bd5-d5c7-41dd-9302-0e1a929372c2)