Help with spirals please. Desperate.
in
Programming Questions
•
1 year ago
Hello, I need some help, ok so the code below is of a spiral circle that's filled in with colors.
void setup () {
size (300, 700);
smooth();
}
void draw() {
background (120);
float s = 450;
while (s > 10) {
float c = map (s, 450, 10, 255, 10);
colorMode(HSB);
fill(c, 255,255);
ellipse (width/2, height/2, s, s);
s -= 20;
}
}
So i created a loop of a bunch of circles and i'm trying to fill each circle in to look like the spirals (code I posted above) I've tried a bunch of stuff but I cant seem to figure it out, everything I try ends up looking different or not running at all. Please help. Below is the Code i'm working with, can someone tell me how to create each individual circle into a spiral.
void setup () {
size(600, 600);
smooth();
}
void draw () {
int d = 60;
background (128);
int counter = 0;
if (counter <= width ) {
ellipse (width/2, counter, d,d);
while ( counter <= width ) {
ellipse (counter, height/2, d, d);
if (counter <= width ) {
ellipse (width/2, counter, d,d);
counter = counter +d;
}
}
}
}
void setup () {
size (300, 700);
smooth();
}
void draw() {
background (120);
float s = 450;
while (s > 10) {
float c = map (s, 450, 10, 255, 10);
colorMode(HSB);
fill(c, 255,255);
ellipse (width/2, height/2, s, s);
s -= 20;
}
}
So i created a loop of a bunch of circles and i'm trying to fill each circle in to look like the spirals (code I posted above) I've tried a bunch of stuff but I cant seem to figure it out, everything I try ends up looking different or not running at all. Please help. Below is the Code i'm working with, can someone tell me how to create each individual circle into a spiral.
void setup () {
size(600, 600);
smooth();
}
void draw () {
int d = 60;
background (128);
int counter = 0;
if (counter <= width ) {
ellipse (width/2, counter, d,d);
while ( counter <= width ) {
ellipse (counter, height/2, d, d);
if (counter <= width ) {
ellipse (width/2, counter, d,d);
counter = counter +d;
}
}
}
}
1