Help with noob on how to create a function

hello
i am trying to create a simple function to change color instead of using :
renderer.material.color = Color.red;
in my script i typed this :

var red = Color.red;
var black = Color.black;

function ChangeColor(colorRef : Color)
{
if(colorRef == red)
{
renderer.material.color = red;
}
else if (colorRef == black)
{
renderer.material.color = black;
}
}

function Update ()
{
ChangeColor(red);
}

I am getting errors ?
Why ?

Could you also post the errors you get?

i figured out it seems it is case sensitive issue. i typed ChangeColor(Red); instead of ChangeColor(red);
is it possible to make it case non sensitive ?
also it it possible to make an else statement, if user typed anything else different than “red” or “black”. Do this Below in the debug :
Debug.Log(“Color does not exist !”);
Thx

I think you could add another else with the Debug.log line so if itsnt one of another it doesnt exists