unity camera change background color code example

Example 1: camera color unity

using UnityEngine;
using System.Collections;

public class Myclass: MonoBehaviour
{
    public Color Red = Color.red;
    
    public Camera cam;

    void Start()
    {
      
      
    }

    void Update()
    {
      
        cam.backgroundColor = Red;
    }
}

Example 2: unity background camera change

using UnityEngine;
using System.Collections;

public class Myclass: MonoBehaviour
{
    public Color Red = Color.red;
    
    public Camera cam;

    void Start()
    {
      
      
    }

    void Update()
    {
      
        cam.backgroundColor = Red;
    }
}