How to make a layer’s labels readable over any background color

Hey, check out the black labels for the black polygon features in this map! Oh, wait, you can’t read them. Ok, I’ll just switch them to white, like this: Foiled again! Now the white features’ labels are invisible. I suppose I could choose a neutral color like gray, but that would still be pretty hard