Palette transition helper functions.