Calling/Applying Texture

Hello,
Basically what im trying to atempt at the moment is, based on mouse click on a pallet of colors my car will change color when i click on that button with that determine color.
What im basically doing is:

//Object used to change Car color 
var ChangedColor : Transform;





function ChangeColor(){ 
   //Change Car
   Destroy(gameObject);
   
   //Instantiate replacement for Diferent Color Car
   var DiferentColor = Instantiate(ChangedColor,gameObject.transform.position,gameObject.transform.rotation);

}   
   

 
  function OnMouseDown () {
   ChangeColor();
    
}

Code changes the object and replaces it with a clone of that same object.
At the moment its not assigned to a button just by clicking the car it changes to the same car(Clone) but with diferent color.
What i wanted to know is if there is a way to call a texture and then apply it on the car instead of having to destroy a object and Instantiante a new one.

transform.renderer.material.mainTexture = textureVariable;

Thanks works perfectly :o