Sharing a material across sprites

I have need of a custom sprite shader that blends between three colours for custom created characters. Each character is drawn of multiple sprite pieces. I can create a custom shader that places these in the fragment code, but then each sprite shares the same material settings, unlike a sprite’s colour value. That means every character needs 6 materials, and with multiple characters that gets unwieldy to manage.

Is there a way to set the colour per sprite? Perhaps using [PerRendererData]? So I can set the colour just as if setting SpriteRenderer.color?

You can create a new material that’s a copy of another material at runtime. I don’t have unity in front of me so there may be syntax errors, but this is generally the code (c#):

spriteRenderer.material = new Material(spriteRenderer.material);
spriteRenderer.material.SetColor(...);