Add copy palette function.