turn gui label red on key down (js)

Hello, i am now stuck. how would i turn the gui label “boost” red when the shift key is held down and the toggle back to black when it is released?

thanks for reading

var timerInSecond = 0;
private var levelTimer = 0.0;
private var updateTimer = false;
var currentTime;
var style : GUIStyle;
function Start()
{
    updateTimer = true;
    levelTimer = 0.0;
}
 
function Update()
{
    if (updateTimer)  
        levelTimer += Time.deltaTime*1;
 
 
    /// float to int
    timerInSecond = Mathf.Round (levelTimer);

    currentTime = levelTimer;
}
 
function LevelEnded()
{
    updateTimer = false;
 
    ///Save Time
    PlayerPrefs.SetInt("Time In Second", timerInSecond );
}
function OnTriggerEnter(box : Collider){
    if(box.gameObject.tag == "box"){
        Debug.Log("timerfinished");
        updateTimer = false;
    }
} 
function OnGUI () {
    
    GUI.Label(new Rect(20,20,400,90), "Time = " + levelTimer,style );
    GUI.Label(new Rect(20,150,400,90), "Boost",style );
   
}

In unity, GUI draws use a common colour for their tint. GUI.color.

to tint certain elements you have to alter this value, and then set it back to ensure further GUI calls dont all get tinted as well. try this as your GUI method.

function OnGUI () 
{
	Color lPrevColour = GUI.color;
	
	GUI.Label(new Rect(20,20,400,90), "Time = " + levelTimer,style );
	
	if(Intput.IsKeyDown(KeyCode.LeftShift))
	{
		GUI.color = Color.red;
	}
	GUI.Label(new Rect(20,150,400,90), "Boost",style );

	GUI.color = lPrevColour;
}