title: Rectangle JavaFx Change color dynamic
body: <p>I am implementing one application to draw rectangle, but now I need help to change color of my rectangles, I have this implementation:</p>
  
  <pre><code>    Pane root = new Pane();
      int qtd = 10;
      NumberBinding rectsAreaSize = Bindings.min(root.heightProperty(), root.widthProperty());
      Text texto = new Text("Matriz C");
      texto.setUnderline(true);
      texto.setLayoutX(150);
      texto.setLayoutY(400);
  
      for (int x = 8; x &lt; qtd + 8; x++) {
          for (int y = 8; y &lt; qtd + 8; y++) {
              Rectangle retangulo3 = new Rectangle();
              retangulo3.setStrokeWidth(2);
              retangulo3.setStroke(Color.BLACK);
  
              retangulo3.xProperty().bind(rectsAreaSize.multiply(x).divide(qtd * 2.5));
              retangulo3.yProperty().bind(rectsAreaSize.multiply(y).divide(qtd * 2.5));
  
              retangulo3.heightProperty().bind(rectsAreaSize.divide(qtd * 2.5));
              retangulo3.widthProperty().bind(retangulo3.heightProperty());
  
              retangulo3.setFill(Color.GREENYELLOW);
  
              root.getChildren().add(retangulo3);
          }
      }
  
  
          root.getChildren().add(texto);
  
          Text texto1 = new Text("Matriz A");
  
          texto1.setUnderline(true);
          texto1.setLayoutX(1200);
          texto1.setLayoutY(200);
  
          for (int x = 30; x &lt; qtd + 30; x++) {
              for (int y = 2; y &lt; qtd + 2; y++) {
                  Rectangle retangulo1 = new Rectangle();
                  retangulo1.setStrokeWidth(2);
                  retangulo1.setStroke(Color.BLACK);
  
                  retangulo1.xProperty().bind(rectsAreaSize.multiply(x).divide(qtd * 2.5));
                  retangulo1.yProperty().bind(rectsAreaSize.multiply(y).divide(qtd * 2.5));
  
              //retangulo.setHeight(10);
                  //retangulo.setWidth(10);
                  retangulo1.heightProperty().bind(rectsAreaSize.divide(qtd * 2.5));
                  retangulo1.widthProperty().bind(retangulo1.heightProperty());
  
                  retangulo1.setFill(Color.WHITE);
  
                  root.getChildren().add(retangulo1);
              }
          }
  
          root.getChildren().add(texto1);
  
          Text texto2 = new Text("Matriz B");
  
          texto2.setUnderline(true);
          texto2.setLayoutX(1200);
          texto2.setLayoutY(500);
  
  
          for (int x = 30; x &lt; qtd + 30; x++) {
              for (int y = 13; y &lt; qtd + 13; y++) {
  
                  Rectangle retangulo2 = new Rectangle();
                  retangulo2.setStrokeWidth(2);
                  retangulo2.setStroke(Color.BLACK);
  
                  retangulo2.xProperty().bind(rectsAreaSize.multiply(x).divide(qtd * 2.5));
                  retangulo2.yProperty().bind(rectsAreaSize.multiply(y).divide(qtd * 2.5));
  
              //retangulo.setHeight(10);
                  //retangulo.setWidth(10);
                  retangulo2.heightProperty().bind(rectsAreaSize.divide(qtd * 2.5));
                  retangulo2.widthProperty().bind(retangulo2.heightProperty());
  
                  retangulo2.setFill(Color.WHITE);
                  root.getChildren().add(retangulo2);
              }
          }
  
          root.getChildren().add(texto2);
  
  
          palco.setScene(new Scene(root, 100, 100));
          palco.show();
  
      }
  </code></pre>
  
  <p>Now I wanna make one superinduce of values and change my rectangle colors like a matriz multiplication, so I am lost in my code because when I create rectangles I have a lot of instances of objects, in the same pane I have three squares of rectangles, how could I make to change the of color of (x,y) like a dinamic thing ? How could I make to resize my image with another dimensions?  </p>