As long as you have two colors only on the screen at any point in time, you are free to switch between palettes.
So you can have black and white, then green and purple, but you cannot fade between the two, you must switch the palette entirely.
You can just turn down the alpha channel of your white, then you got your grey and don’t is bending the rules