I recently created a double pendulum and wanted to make the tracing line run through all the colors, I looked around and couldn’t find anything that did what I wanted so I made my own.
float h = 0;
float x = 0;
void setup(){
size(500, 500);
background(0);
colorMode(HSB, 360, 360, 360);
}
void draw(){
if (h > 360){
h = 0;
}
h += 2;
strokeWeight(4);
stroke(h, 360, 360);
point(x, height/2);
x += 1;
}
This is what I came up with, hope this helps anyone looking for a similar thing.
Archie Wright.