def METHOD_NAME(self):
    new = ImagePalette()
    new.mode = self.mode
    new.rawmode = self.rawmode
    if self.palette is not None:
        new.palette = self.palette[:]
    new.colors = self.colors.METHOD_NAME()
    new.dirty = self.dirty
    return new