from joy import *
Trippy visual.
#Recursive donut patterns.
#random fill color
one_color = color(r=random(10,225),g=random(10,225),b=random(10,225))
two_color = color(r=random(10,225),g=random(10,225),b=random(10,225))
#black base color
base = rectangle(w=300,h=300,fill="black")
c1 = circle(r=10,x=-135,y=0, stroke=one_color, stroke_width=3)
c2 = circle(r=5,x=-135,y=0,fill=two_color, stroke="none")
donut = combine([c1,c2])
output = donut | repeat(20,scale(0.85)|rotate(5)) | repeat(36,rotate(10))
show(base, output)
Inspired by Jackson Pollock's art.
#Abstract generative art - Random lines generator.
# Inspired by Jackson Pollock's art.
#No of lines.
n=250
#Background
abstract_lines = rectangle(w=300, h=300, fill="black")
# Random color generator.
def random_color():
r = random(255)
g = random(255)
b = random(255)
a = random(0.1,1)
return color(r=r, g=g, b=b, a=a)
# Random Line Generator Function.
def line_gen():
x1,y1=random(-150,150),random(-150,150)
x2,y2=random(-150,150),random(-150,150)
str_width=random(1,7)
return line(x1,y1,x2,y2,stroke=random_color(),stroke_width=str_width)
for i in range(n):
abstract_lines=abstract_lines+line_gen()
show(abstract_lines)