GUIElement.color

Why in this section my .color is not recognized as beeing a member of GUIElement ?

function fade(direction:boolean){
   var alpha;
   
   if (direction){
      if (guiElement.color.a < 0.5){
         timeLeft = timeLeft - Time.deltaTime;
         alpha = (timeLeft/fadeDuration);
         guiElement.color.a=0.5-(alpha/2);
      } else {
         timeLeft = fadeDuration;
      }
   } else {
      if (guiElement.color.a > 0){
         timeLeft = timeLeft - Time.deltaTime;
         alpha = (timeLeft/fadeDuration);
         guiElement.color.a=alpha/2;
      } else {
         timeLeft = fadeDuration;
      }
   }
}

GUIElement.color does not exist. Perhaps you’re looking for GUI.color instead? Setting GUI.color will affect each GUIElement that comes after it, so make sure you set GUI.color back to whatever color you want for the elements which appear after the element your trying to modify!