SDL_SetPaletteColors works with an SDL_Palette rather than a SDL_Surface directly… I never found an API to say “now associate this palette with this surface”.
Searching for both these SDL functions brought me to a specific code example in https://wiki.libsdl.org/SDL_PixelFormat:
> we use that index to read the SDL_Color structure from surface->format->palette->colors
So I can access the palette with surface->format->palette. Hurray! Thanks a bunch 😊
"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko