Add create and free functions for palettes.