Change specific colors in textures to other specific colors (pallet swap)

So I’m making a game using OpenGL, and I’ve gotten by by using multiple tutorials, however I am still pretty unfamiliar with using most of OpenGL. I have no idea how to change the color of pixels in textures, or how to really use FBOs. I need to be able to change my character’s colors like how Mega Man changes his colors, but I have no idea how to do this with OpenGL, and I haven’t been able to find anything helpful on this despite searching for LITERALLY WEEKS! Could someone please help me?

Or… you could simply use a sprite sheet with all the colors you want your character to have. That’s pretty much what most 2D games would have implemented.

I’ve never played Mega Man, but given that it appears to be an NES game, I’m assuming that it uses colour-index (aka colour-mapped, paletted) textures. Apart from the EXT_paletted_texture extension (which isn’t supported on modern hardware), OpenGL doesn’t support these directly. However, you can implement them yourself using a fragment shader.