Q:

how does javafx compares 2 colors and knows they are the same or different? 

I'm doing an project for school, we have to make the game memory, i think you all know the game.  Our problem is that we don't understand how javafx compares two 'cards' 
The code we have now is for 4 cards and you can click on them and they wil turn into a color and when you click they will turn back.  Can you guys please help me?  
My current code is like this:
rectangle:rectangle1 = Rectangle { 
    width: 50 
    height: 50 
    x: 10 
    y: 50 
    arcWidth: 10 
    arcHeight: 10 
    fill: bind Color.web(kleur1) 
    onMouseClicked: function(event) { 
        if (kleur1 == "red"){ 
            kleur1 = "blue"
        } 
        else if (kleur1 == "blue") { 
            kleur1 = "red"} 
        } 
}

A:

It appears you need to check if the Color is equal
 if(kleur1.equals("blue") && kleur3.equals("blue"))
 {
      rectangle1.setVisible(false);
      rectangle3.setVisible(false);
 }

and do set visible like above

