-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtiranga.js
60 lines (39 loc) · 904 Bytes
/
tiranga.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
50
51
52
53
54
55
56
57
58
59
let cx, cy;
let radius;
function setup() {
createCanvas(900, 600);
noStroke();
radius = min(width, height) / 2;
text(radius, 100,100);
cx = width / 2;
cy = height / 2;
}
function draw() {
push();
fill(255, 153, 51);
rect(0, 0, 900, 200);
fill(255, 255, 255);
rect(0, 200, 900, 200);
fill(19, 136, 8);
rect(0, 400, 900, 200);
pop();
fill(0, 0, 128);
ellipse(cx, cy, 195, 195);
fill(255, 255, 255);
ellipse(cx, cy, 180, 180);
fill(0, 0, 128);
ellipse(cx, cy, 35, 35);
push();
stroke(0, 0, 128);
strokeWeight(2);
beginShape(POINTS);
for (let a = 0; a < 360; a += 15) {
let angle = radians(a);
let x = cx + cos(angle) * (radius * 0.3);
let y = cy + sin(angle) * (radius * 0.3);
vertex(x, y);
line(x, y, cx, cy);
}
endShape();
pop();
}