Quad Gradual Colour Change


I’m trying to change the colour of a quad, used as background. Specifically I’m attempting to change the colour of each r, g and b values as a Color object incrementally within a Update() method. So far I’m not having much luck. I’ve noticed the following line of code will change the quads colour accordingly…

GetComponent<Renderer>().material.color = Color.black;

However if i attempt the following…

	private Color skyColour;
	private float r, g, b;
	void Start () 
		r = 206f;
		g = 140f;
		b = 21f;

		skyColour = new Color(r,g,b);

	void Update () 
		//skyColour = new Color(r,g,b);
		GetComponent<Renderer>().material.color = new Color(r,g,b);

It doesn’t assign the desired colour. Even including alpha values. The colour is set too white. The shader is set to Unlit/Color.

I’ve breifly looked into solving the problem myself but I figured posting up here might help save time whilst looking into it. Any help would be muchly appreciated

So the only time it doesn’t give you the color you expect is when you use color attributes you specify? What if you use some of the other standard colors - Color.green, Color.red, Color.yellow, Color.blue… how do those look?

What color space are you rendering in? Although I’m not completely sure if that is only affected by lights, it’s worth checking out.