Is there a Color Picker Solution for a 2D Character Sprite Editor?

Hi Unity Forums,

I am creating a 2D Character editor for my Isometric game, and am looking to add unlimited variations for players to select coloring of certain character elements. Because I am creating the animation frames in layers instead of using Bone Based animation, I am wondering if there is a tutorial or theorized solution so users can change the color hue of sprite elements instead of manually creating multiple images of the same sprites saved out in different colors.

For example: I have 40 head types to select, 3 Body Types, and multiple pieces of clothing. I would like to provide players with a Color Picker to select skin tone, hair color, clothing color, and eye color to help offer more variation when they design a character.

Seeing as I am a beginner to the Unity world, if anyone has any ideas or advice on how to accomplish this, that would be helpful. Perhaps there is a solution for this using shaders?

Thank you!

Have you looked into using SpriteRenderer.color? I’m not saying it’ll work but it’s worth a shot until you get a better answer!

Thank you for the idea, and it looks like the “Color” struct has some useful information - I am going to see if maybe I can cobble together a working code that applies a Hexcode or RGBA value to the sprites using some of the operators that multiply, replace, or mix colors. ( Link to Color here. )

Thanks for the jumping off point! If anyone else has an idea on this, other comments or ideas are welcome.

I’m gonna give you a better answer, because i tried this out and i have a working version.
you could make a:
public Color character;

for the color picker youll want 3 values:
public float red, green, blue;

then youll need to implement your own way to change how much red/green/blue is added to the sprite.

youll will send these values to:
character = new Color(red, green, blue);

and maybe in your Update() you could put:
gameObject.GetComponent().color = character;

and now you have player custom sprite color.

p.s. the RGB values range from 0-1. theres Color32 which uses the 255 scale i think.