I need to change the color of my
SpriteRenderer, and so I looked up how to do it and come up with this code:
spaceOne.GetComponent<SpriteRenderer>().color = new Color(166, 33, 33);
(In case you are wondering, yes I checked that 'spaceOne' is correctly linked to a
This should change the color, but it doesn't. As I was writing this, I found that replacing
new Color(166, 33, 33); with
Color.red; actually does change it to red.
So now I am wondering, why does the
new Color(166, 33, 33); code not work, and how can I fix it?
P.S. I made sure that it wasn't something simple, like it being RGBA rather than RGB, but no, it still doesn't work with
new Color(166, 33, 33, 255);.