Working at night? I’m sure you know f.lux. But try to set it to more warm values like 1600K. Black text remains black, white areas turn candle yellow, which is all good, but blue and green buttons and icons will become indistinguishable from each other.

Yes we can use only black, white and red colors hardcoded in our apps, but is there any better solution for this?

What if the GUI color set was kind of „responsive“?

The warmer temperature is set, the more apps should stop to treat green and blue elements as differently colored. I can imagine there’s an system library / API for this, included with OS, which would help apps to automatically start replacing some GUI colors when OS gets request for setting a warmer screen. When the screen gets close to 1600K and warmer, the apps should consider to stop using different colors for interface completely. The UI should settle on red and black colors and stop to use differently colored elements, other colors are no longer distinguishable anyway. Doesn’t it remind you a real world?