I'm making a sport management game in C# - WPF. I have a template image of a person wearing a cap and shirt, representing a player.
I want to dynamically recolor the shirt and cap that the player is wearing depending on the team he's playing for. The Team object has 2 Color variables, a Primary & Secundary color.
For now I've used a Flood Fill algorithm that edits a Bitmap object. afterwards I need to convert the bitmap to an Imagesource.
The whole thing takes a fair bit of code and is fairly complext that I now doubt if I'm actually doing it in the "correct" way, or if there are better approaches to my initial goal, which is coloring an outfit to match the team colors.
(another issue I have is the flood fill is also a bit complicated if I start to use a more gradient template - for shadows for example - instead of flat colors)