How can I change the color of a light over time?

If I have two defined colors (public Color earlyMorning = new Color (95f, 59f, 168f, 1f):wink: ect. How can I change the color of a light over, say, 60 seconds?

I tried light.color += earlyMorning / 60 * Time.deltaTime; however, if I log the color of the light to the console every frame, it only increases the alpha value.

So, what is the most effective method to change the color of the light over time?

If you Google “Unity3d change color over time”, you will find many hits, many with scripts. Here is one:

I would look up color lerping…

if you need more help understanding the lerp function let me know.

Just attach this to the camera and set its clear flags to solid color!

var color1 : Color =;
var color2 : Color =;
var duration = 3.0;

// Set clear flags to color
camera.clearFlags = CameraClearFlags.SolidColor;

function Update () {
    var t : float = Mathf.PingPong (Time.time, duration) / duration;
    camera.backgroundColor = Color.Lerp (color1, color2, t);