Skip to content

Instantly share code, notes, and snippets.

@schani
Created June 19, 2013 20:39
Show Gist options
  • Select an option

  • Save schani/5817838 to your computer and use it in GitHub Desktop.

Select an option

Save schani/5817838 to your computer and use it in GitHub Desktop.
colors = [orange, blue, red, green, black, purple]
fractal = (x, y, r, depth) =>
e = ellipse x, y, r, r
e.fill = gradient(colors[depth], colors[depth+1])
add e
if depth > 0
for d in [-2*r, 2*r]
fractal x+d, y , r/3, depth-1
fractal x , y+d, r/3, depth-1
fractal 160, 284, 80, 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment