timer script with GUI HELP

hi i made a timer script:
#pragma strict

var timer : float = 10.0;

function Update ()
{
timer -= Time.deltaTime;

if(timer <= 0)
{
timer = 0;
//do something
Debug.Log (“timer on 0”);
}
}

function OnGUI ()
{
GUI.Box(new Rect(10, 10, 90, 25), “Hunger:” + timer.ToString(“0”));
}

in //do something i want that the gui colors red if the timer is red how do i do that? thx
ps/ you can use the script if you want

// add before update

// variable to hold the color you want to use
Color myTextColor;

function Start()
{
// set the color to something 
myTextColor = Color.green;
}
// do something => change color
myTextColor = Color.red;
function OnGUI()
{
// set color to be used in drawing the box
GUI.color = myTextColor;
GUI.Box(new Rect(10, 10, 90, 25), "Hunger:" + timer.ToString("0"));
}

I highly recommend you look at the new UI system and move away from trying to figure out the old legacy OnGUI system. If you are just starting out it’ll be far simpler to learn.

I think unitys legacy OnGUI system is far simpler for a beginner, it might be, because I used to the, with canvas it’s harder to create ui elements and harder to manipulate them. It is more professional than easier.