How can I spawn the same 2D sprite prefab with different colors randomly?

I want the prefabs to spawn with different colors from a spawnerObject that I have, but I don’t want it to be completely random, I need it to intercalate between three colors like Red, Green and Blue. And I need to store the color in a variable so I can validate wich color the prefab spawned. In C#. I’m not sure if you can understand my question, but thanks anyways.

Your term “intercalcate” confuses I have no clue what you mean by that.

If I’m understanding you correctly what you want to do is randomly assign a sprite a color either Red, Blue or Green in this case. If this is true the use of a switch statement is what I recommend. Start by assigning each color to an integer, for example, Red is 0, Blue is 1, and Green is 2. Get an integer from a Random.Range(0, 3) include 3 because integers are exclusive. Then run it through a switch statement if the integer is 0 assign the spriterender.color to red and so on for the other colors.