Camera.backgroundColor Manual     Reference     Scripting  
Scripting > Runtime Classes > Camera

var backgroundColor : Color


The color with which the screen will be cleared.

Only used if clearFlags are set to CameraClearFlags.SolidColor (or CameraClearFlags.Skybox but the skybox is not set up).

// ping-pong animate background color
var color1 =;
var color2 =;
var duration = 3.0;

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

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

See Also: camera component, Camera.clearFlags property.