I would like to invert the screen colors with a script (osascript, bash, applescript or even with something in C code).
The closest thing I have found is toggle the dark theme.
> osascript -e 'tell app "System Events" to tell appearance preferences to set dark mode to not dark mode'
I tried a lot of things, but without any luck. I was able to change the defaults file, but I want the changes to apply without logging out.