Here's a silly-looking – but not frivolous – program I wrote yesterday. (I tooted about it deep in a thread yesterday, but I think it deserves sharing more widely.)
It runs a subprocess (by default a shell) inside a pty, similarly to 'script' or 'ttyrec' or 'luit' or other wrapper programs. In the output stream, it intercepts terminal control sequences that set the foreground and background colour, and rewrites them to select different colours.
So you get to remap your colours however you like without having to hack on your actual terminal program – the colour rewriter is a separate tool sitting in between your shell and the terminal.
In the screenshot, the demo application for this technology is a silly one: it just permutes the R,G,B channels of all the colours, to prove it's doing _something_.
But the purpose isn't frivolous at all. It's intended as a test bed for experimenting with colour remapping rules that improve readability: you can rewrite fg and bg colours as a pair, with awareness of each other, so you can improve contrast in whatever way your particular colour vision finds useful. All you have to do is decide what remapping you want to do.
This is an experimental test bed, so for the moment, you have to implement a rewriting rule by editing a function inside the C program and recompiling. An obvious extension would be to make that easier, via a plugin system or an embedded DSL or something, but I threw this together in a couple of hours yesterday evening, and haven't done anything that complicated. (Yet.)