I'm trying to replicate a RTC game as a pet project. The thing is, the units have a .BMP palette. From index 0 to 63, palette colors will be combined to the player color, since that parts of the unit are the ones that make possible for us to distinguish the owner of the unit. I know the red color used for player 1 is (255, 32, 32). I have some values extrapolated from the game as the result. I need to find an algorithm that makes possibly to do the following transformation:
Palette (108, 68, 51) Red player (255, 23, 23) Result (115, 8, 8)
Palette (87, 85, 84) Red player (255, 23, 23) Result (214, 16, 16)
Palette (90, 69 ,67) Red player (255, 23, 23) Result (181, 8, 8)
I suppose the thing has to do with color Value/Saturation/Luma but I couldn't find the correct formula that, at least, gives us a nearby result.
Thanks in advance. I'll keep investigating, anyway I prefer to share this in advance because maybe there's some color expert here.