public void drawGrid() { for (int i = 0; i < 4; i++) { for (int j = 0; j < 4; j++) { if (gridA[i][j].getValue() == 0) { fill(255); rect(j * 105, i * 105, 100, 100); } else { fill( (float) (256 - (256 / 11) * (Math.log(gridA[i][j].getValue())) / (Math.log(2))), (float) ((256 / 11) * (Math.log(gridA[i][j].getValue()) / Math.log(2))), (float) 0.0); rect(j * 105, i * 105, 100, 100); fill(255); text(toString(gridA[i][j].getValue()), j * 105 + 50, i * 105 + 50); } } } }