-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path__main__.py
40 lines (34 loc) · 898 Bytes
/
__main__.py
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
"""2024-01-14
Genuary 14 - 1kb.
Mandala gerada com menos de 1Kb de código.
png
Sketch,py5,CreativeCoding,genuary,genuary14
"""
import py5
from utils import helpers as H
sketch = H.info_for_sketch(__file__, __doc__)
X = H.LARGURA
Y = H.ALTURA
def setup():
py5.size(X, Y)
py5.background(0)
py5.stroke_weight(1)
py5.no_fill()
py5.rect_mode(py5.CENTER)
d = 800
while d > 10:
r = py5.remap(d, 0, 800, 0, 255)
for A in range(0, 360, 12):
g = (A / 2) * 1.5
b = py5.random_int(20, 255)
with py5.push_matrix():
py5.stroke(r, g, b)
py5.translate(X / 2, Y / 2)
py5.rotate(py5.radians(A))
py5.rect(0, 0, d, d)
d = d / 1.5
H.write_legend(sketch)
H.save_sketch_image(sketch)
py5.exit_sketch()
if __name__ == "__main__":
py5.run_sketch()