Unless you need to change between many quite random pallets of many things, then you may be better off creating those sprites beforehand (I'm sure you can do pallet swaps extremely easily in any good graphics editor) and then loading them into the game. Use more memory and less cpu, or use more cpu and less memory, that is the question :p (GM also used to have a built in function for this in its past versions which disappeared around 7 I think. No idea what it has no though.)