The way it's supposed to work is you don't touch the terminal colors but instead configure the program to use different colors. So you don't invert black for a dark theme, instead the program uses white instead of black.
By the way, the terminal foreground and background colors are independent of the standard 16 colors, which complicates things.