Surface.set_at should be able to accept a color index integer for Surfaces with a palette, to set the pixel to that color index.