MV Trying to make a system that allows changing palettes.

Hello everyone, I got a frivolous feature in my game I want to include, but I have no clue where too start with making my own javascript.

Basically, in my game, I want to have a feature that allows the player to change certain colors on the characters, for example one of them has red hair, and I'd like them to be able to change it to say, blonde, brown, or even blue or green if they want. However not just the hair, but their shirts, pants, shoes, vest etc.

So I'm thinking the easiest way to do this would be to have a filter that could read a color like say, 129, 183, 89, (Green) and instead display it as something like 255, 128, 0, (Orange). Furthermore, this must effect pictures as my game uses a ton of them.

Now, like I stated above, I got no clue where to start, like I don't know how to get the game to select a color, or even change it into another color. If anyone could give me some pointers or if possible a link if someone has done this already, it would be very much appreciated. Thank you very much.
From what I saw there are already other topics making the same type of request, but it seems that it is not so easy:

There is this option with RGSS3 (VXACE), but RMMV works quite differently when it comes to more complex systems.

Reference:

Good luck
Thank you for the help, I'm going to look into that article you posted as it may be in the general direction I need.

However I should note, and I may be talking about the same thing here without knowing it, I'm not looking for a hue slider but more something that tells the game to display a specific color as another one.

I'm not sure how best to describe it, I guess like if one were to open a sprite sheet on MS Paint and change a red circle to a blue one. Something like that which could have the game do that automatically.

The best example I could give is a little niche, but if anyone here has dabbled in M.U.G.E.N. at all, many characters are made with bizarre color schemes, which allow the engine to reinterpret the colors and change then as needed during gameplay, allowing alternate palettes to be made very easily.

If I'm going in circles, sorry. Anyways, like I said I'll look into that article, as skimming through it, I saw what may indirectly have the answer I need, so maybe I can Frankenstein something together. So thank you for the links, I'll post an update if I get something working and if anyone else has any good tips or articles that would be greatly appreciated.
It is practically the same way, the older systems already had the base prepared to work with a color palette, this due to the low storage space and processing limitations.

M.U.G.EN has a different reading base for graphic files, probably part of the use is DirectX, I cannot confirm.

About WebGL or Canvas, I don't have a lot of knowledge on the subject, but I assume that using a color palette system in real time would consume much more of the player's device due to rendering, even more at 60 fps.
It would be easier to have a paper doll exchange system, where you would adjust your hair and clothes with ready-made variations, this is seen mainly in 2D MMORPG.

Good Luck

Original thread: https://forums.rpgmakerweb.com/threads/trying-to-make-a-system-that-allows-changing-palettes.136061/