I have this snip it from my code below, and I would like to slow down the rate at which the color randomly changes. I know that is the point of random, but I will be presenting this in class and anyone who has photosensitive epilepsy may get a seizure due to the quickly changing colors so I want to slow it down. This is the part that changes the color so I only posted only those but if I should post more code please let me know. This code is for a shape I have in the middle of my animation that changes color. I have tried looking up random and saw that I can put random(high) and random(low) but that didn’t work. Any suggestions? Thanks.
void show() {
float temp= random(0, 100);
//if the speed of the stars is less than 50 then we display random colors for the stars with no outline which is the noStroke
if (temp > 10 )
fill(random(0,255), random(0,255), random(0,255));
else
fill(random(0,255), random(0,255), random(0,255));
noStroke();
// map will give new star positions
// the division x / z get a number between 0 and a very high number,
// map this number (proportionally to a range of 0 - 1), inside a range of 0 - width/2.
//this makes sure the new coordinates "sx" and "sy" move faster at each frame
// and which they finish their travel outside of the canvas (they finish when "z" is less than a).
float sx = map(x / z, 0, 1, 0, width/2);
float sy = map(y / z, 0, 1, 0, height/2);
//the z value to increase the star size between a range from 0 to 16.
float r = map(z, 0, width/2, 16, 0);
ellipse(sx, sy, r, r);
//use the "pz" valute to get the previous position of the stars,
//to draw a line from the previous position to the new (current) one.
float px = map(x / pz, 0, 1, 0, width/2);
float py = map(y / pz, 0, 1, 0, height/2);
pz = z;
stroke(255);
line(px, py, sx, sy);
}
}