Hello!
I am trying to work out how to implement more control of color placement within grid systems.
The very simple solution I’ve come up with so far (for one iteration of diagonal color placement) is partially successful in that the desired sections/locations are acknowledged (the background shows through).
However, the application of any styling to the rectangles–fill, stroke, strokeWeight–does not appear.
I also tried enclosing the if-statement with pushStyle/popStyle(). But no success.
I have tried different colors, colorModes, strokeWeights, etc.
Any advice on why this is happening is most welcome.
////////////////////////////////////////////////////////////////
int rows = 4;
int cols = 4;
int sz = 100;
void setup() {
size(400, 400);
noLoop();
//frameRate(1);
//background(0);
//colorMode(RGB);
//colorMode(HSB);
}
void draw() {
for (int i = 0; i<cols; i++) {
for (int j = 0; j<rows; j++) {
if (i==j) {
//strokeWeight(4);
//stroke(255, 0, 0);
//fill(255, 0, 0);
fill(0);
} else {
//strokeWeight(2);
//stroke(0);
fill(255);
rect(i*sz, j*sz, sz, sz);
}
}
}
}