Cube Turns into Sphere Upon Collision [Beginner]

I’m attempting a project that involved a cube that falls onto a plane and converts to a rigid body sphere upon collision. The plan would also change color when collided with. This is the code I have so far:

public GameObject hitGO;

// Use this for initialization
void Start() 
{

}

// Update is called once per frame
void Update() 
{
	
}

void OnCollisionEnter(Collision collidedwith)
{
	hitGO = collidedwith.gameObject;

	{
		hitGO.GetComponent<Renderer>().material.color = Color.blue;
	}
}

}

I believe that your code doesn’t sit on the cube but on the thing the cube is colliding with. My example below is on the same basis.

using UnityEngine;

public class Test : MonoBehaviour

{
    Mesh mesh;
    [SerializeField] GameObject sphere;

    private void Start()
    {
        GameObject tempGO = GameObject.CreatePrimitive(PrimitiveType.Sphere);
        mesh = tempGO.GetComponent<MeshFilter>().mesh;
        Destroy(tempGO);
    }

    private void OnCollisionEnter(Collision collidedwith)
    {
        GameObject hitGO = collidedwith.gameObject;
        hitGO.GetComponent<MeshFilter>().mesh = mesh;
        hitGO.GetComponent<Renderer>().material.color = Color.blue;
    }
}