In my project, I want to change the color of a square at runtime which is simply a game object with an Image component.
In my script I proceed like this:
private Image imageRenderer;
imageRenderer = ImageCompleteSquat.GetComponent<Image>();
imageRenderer.color = Color.red;
In this case, it works and the image turns red as expected. But as soon as I change this line by putting my own RGB color like this:
imageRenderer.color = new Color(227, 66, 52);
The image is not displayed anymore: it disappears.
Does anyone know how to change the color of an Image component?