Visual Experiment 10 (Processing)

Tags:

While exploring the book “Generative Gestaltung,” we came across very interesting examples, such as this color spectrum, in which the color and size of the patterns change based on the mouse’s position on the X and Y axes. I found this example to be very visually appealing, especially since something so visually attractive can be achieved with very few lines of code.

int stepX;
int stepY;

void setup(){
  size(800,400);
  background(0);
}

void draw(){
  colorMode(HSB, width, height, 100);
  noStroke();
  
  stepX = mouseX+2;
  stepY = mouseY+2;
  
  for (int gridY=0; gridY<height; gridY+=stepY){
    for (int gridX=0; gridX<width; gridX+=stepX){
      fill(gridX, height-gridY,100);
      rect(gridX, gridY, stepX, stepY);
    }
  }
}
Bohnacker, H., Groß, B., Laub, J., & Lazzeroni, C. (2009). Generative Gestaltung: Entwerfen, Programmieren, Visualisieren. Verlag Hermann Schmidt GmbH & Co. KG. https://www.amazon.de/gp/product/3874397599?ie=UTF8&tag=genegestwebsz-21&linkCode=as2&camp=1638&creative=6742&creativeASIN=3874397599