Unable to find the answer to this in REFERENCE section.
I have a very simple program to generate random color block overlaps.
Currently set up to record a PDF of each instance when code runs.
How do I generate a new name for the PDF each time code is run (otherwise it’s the same file name each time and overwrites the previous PDF file)?
CURRENT CODE BELOW:
import processing.pdf.*;
float randomH1 = random(300, 400);
void setup() {
size (400, 600);
noLoop();
beginRecord(PDF, "filename.pdf");
}
void draw() {
background (255);
noStroke();
fill(150, 220, random(255), 150);
rect(0, 0, width, random(150, 275));
rectMode(CENTER);
fill(random(255), 185, 185, 150);
rect(width/2, height/2, width, random(150, 250));
fill(random(255), 225, 90, 150);
quad(0, height, width, height, width, randomH1, 0, randomH1);
endRecord();
}
Many thanks to anyone who can help me with this!