title: Integer Value to Color (JAVA)
body: <p>I made an 2D Array filled randomly with numbers between 0 and a number selected by the user (max 6). I would like to change those numbers with colors, but when I try to assign each value to a color I get the message that I cannot convert from int to color... Any recomendation? because I'm really stuck</p>
  
  <pre><code>    public static void rellenarTablero(int[][] tablero) {
      System.out.println("Introduzca el numero de colores (de 2 a 6): ");
      Scanner in = new Scanner(System.in);
      int colores = in.nextInt();
      while(colores&lt;2||colores&gt;6){
          System.out.println("Elija un numero valido:");
          colores = in.nextInt();
      }
      for (int x = 0; x &lt; tablero.length; x++) {
          for (int y = 0; y &lt; tablero[x].length; y++) {
              tablero[x][y] =1+(int)(Math.random()*(colores));
              if(x==1){
                  x=Color.BLUE;
              }if(y==1){
                  y=Color.BLUE;
              }
              if(x==2){
                  x=Color.RED;
              } 
              if(y==2){
                  y=Color.RED;
              }
              if(x==3){
                  x=Color.GREEN;
              }
              if(y==3){
                  y=Color.GREEN;
              }
          }
      }
  }
  </code></pre>