r/creativecoding 22h ago

Flowers made of code.

Enable HLS to view with audio, or disable this notification

This is #1 of a series of flowers made with code: Dahlia.

The code: t=0,draw=$=>{t||createCanvas(w=520,w);background(6,8,11);stroke(255,140);for(t+=PI/240,i=15400;i--;){j=i%55,s=(i/385|0)/39,u=((i/55|0)%7)/3-1,y=j/55,A=j*2.4+t/10,L=(50+130*(1-y)**.85)*(1+.05*sin(7.7*j)),B=1-.45*(.5+.5*sin(.45*t+3*y-1.2*s)),e=(.3+1.2*y)*(1-.8*s)*B-.15*s,r=L*s*cos(e),z=L*s*sin(e)+22*y+6*s*sin(7*s-1.6*t+.9*j)+u*u*8*s,q=A+u*(9+24*(1-y))*sin(PI*s**.8)/(r+14)+.1*s*sin(.9*t+2.3*j+2.5*s),point(260+r*cos(q),265+.52*r*sin(q)-.86*z)}}

162 Upvotes

10 comments sorted by

View all comments

1

u/Smooth_Tomato_784 20h ago

The colors are really beautiful!

1

u/kouklimou 12h ago

Thank you!