Changing the tint colour of materials

EDIT: I have now got the script working but it’s makes the material a instance, and doesn’t change all the meshes with this material on.

So i'm trying to achieve something which I thought'd be really simple but turns out to be very difficult. My game object has 4 seperate materials attached to different sections. I want to be able to change the tint colour of each or replace the material to another preset through UI. Here's in code what i basically want it to do : 

#pragma strict

var rend : Renderer;
var Blinn1 : Material;
var Blinn2 : Material;
var Blinn3 : Material;
var Blinn4 : Material;



function Start () {
	
}

function Update () {
	
}

function MatYellow(){

    rend.material.color = Color(0, 0, 0);
    Debug.Log("yellow");
}

function MatRed(){

    Debug.Log("red");
}

For MeshRenderers with only one material:

renderer.sharedMaterial = newMaterial;

For MeshRenderers with multiple materials:

Material[] mats = renderer.sharedMaterials;
mats *= newMaterial;*

renderer.sharedMaterials = mats;