Not FOSS but free - ReadEra, it’s working extremely well. No ads or anything, the only feature the paid version has is cloud sync of your library, and sync reading progress across devices.
Been using it for 8 years or so, bought it at some point just because it works without a hitch since basically forever.
I use Okular and sometimes Zathura, both can do that through hotkeys (you can also add a button to the toolbar in Okular)
In Okular (for desktop), you can set keyboard shortcuts for various color inversion/shifting modes. Or you can permanently set one in the Accessibility settings.