Color picker and mouse position

I have an object that has a rotate script. I also have a GUI texture button that when is pressed a color picker appear. I want to disable the rotate function when my mouse is over the color picker.

I came up with this code which is not working.

This function is in the rotate script :

function isCameraInputIgnored () : boolean {
otherScript  = Camera.main.GetComponent(colorPicker); 
    //should be true isf the  color picker is present
var mousePos : Vector3  = Input.mousePosition;
    // invert the y-coordinate 
     mousePos.y = Screen.height - mousePos.y;
    if (otherScript.colorPickerPresent)        
           return true; //mouse is over color picker
    return false; //if mouse isn't over 

}

This function is in the color picker script :

static var colorPickerPresent = false;
static var colorPickerRect : Rect = Rect(820,190,150,150);

function Update(){
var mousePos : Vector3  = Input.mousePosition; 
// invert the y-coordinate 
mousePos.y = Screen.height - mousePos.y;
print(mousePos.y);
if (colorPickerRect.Contains(mousePos))
   colorPickerPresent = true;
colorPickerPresent = false;
}   

alt text

You need an 'else' after your if!

function Update(){
    var mousePos : Vector3  = Input.mousePosition; 
    // invert the y-coordinate 
    mousePos.y = Screen.height - mousePos.y;
    print(mousePos.y);
    if (colorPickerRect.Contains(mousePos))
    {
       colorPickerPresent = true;
    } else { // THIS BIT IS VITAL
        colorPickerPresent = false;
    }
}

What was happening there was, it was checking the mouse position, well and good, but after it did that it then completely ignored the result and set colorPickerPresent to false anyway!

Alternatively, you can just use this one line-

colorPickerPresent = colorPickerRect.Contains(mousePos);