I am trying to modify the HSV values of my ingame sprites via this code:
float greenLv = 0.1f;
//Access each childrenderer in the game
foreach (Renderer childRend in rend) {
Debug.Log (childRend.name);
currColor = childRend.material.color;
Debug.Log ("currentColor" + currColor);
Color.RGBToHSV (currColor, out h, out s, out v);
Debug.Log (" child HSV values colors " + h + "," + s + ","+ v);
currColor = Color.HSVToRGB(greenLv,greenLv,greenLv);
childRend.material.color = currColor;
}
For some reason, the HSV values I get are always (0,0,1) - which should mean the color black? Even though I know for sure the sprite isn’t black. Is it getting the first pixel it encounters? How can I possible edit the overall tint of a sprite?
Thank you in advance!