Hi All,
I’m trying to change the color of an image. My image is set to ‘Sprite (2D and UI)’ and it’s an Image on a Canvas (in this case a health bar).
I can’t change the image color by code or in the inspector. See screenshot of me trying to adjust the color by making it a dark red, yet the image doesn’t change color at all. *I don’t actually want to make it red, it’s just an example of how messing with the color or transparency has no effect on the image.
What am I doing wrong??
Thx!
How does it look in the scene view? I’m don’t think that preview on the inspector will actually change, it just shows the source image.
For example here’s a screenshot from one of my projects. The preview in the boottom doesn’t change but the actual image in the scene view on the left certainly matches my tint color:
By the way the “Color” field on an Image component is kind of a “Tint”. it’s pretty much multiplied to the source image to get the result. SO if the source sprite is dark green, making it red will result in some kind of kludge between red and green. You’re better off having a grayscale source image which can then be freely and fully colored by tinting it through the Color field in the Image component.
Ah, yeah it doesn’t change in the inspector (it’s a prefab) but the instance does change in the scene view. Thanks for that.
Totally get changing color changes tint - I’m actually trying to make transparent, I was just using that as an example.
This has been helpful, thanks.
1 Like