-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChallenge 5.js
49 lines (39 loc) · 1.02 KB
/
Challenge 5.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
function setup() {
createCanvas(425, 900);
background(255);
}
function draw() {
//Top circles
//Inital stuff
topCircleX = 25;
topCircleY = 25;
topCircleColour = 0;
stroke(0);
//how many rows to draw
for(let rows = 16; rows > 0; rows--){
//how many circles in a row
for(let circles = 16; circles > 0; circles--){
//Sets the colour
fill(topCircleColour);
//sets the place
circle(topCircleX, topCircleY, 25);
//changing the colour and the x
topCircleColour += 1;
topCircleX += 25;
}
//Changes the y
topCircleY += 25;
//Resets the x for the next row
topCircleX = 25;
}
//Bottom circles
//big circle slowly gets smaller while colour gets more intense
noStroke();
for(let circleNum = 255; circleNum > 0; circleNum--){
//circleNum decides the amount of green
//the minus provides the intial green values so it becomse more pronounced
fill(255, circleNum - 30, 255);
//draws the circle
circle(width/2, 700, circleNum);
}
}