Skip to content

Commit

Permalink
Color_spiral.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhidongre authored Oct 5, 2022
1 parent a2fc6fe commit eaba6ea
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions colour spiral.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# import turtle

import turtle

# defining colors

colors = ['red', 'yellow', 'green', 'purple', 'blue', 'orange']

# setup turtle pen

t= turtle.Pen()

# changes the speed of the turtle

t.speed(10)

# changes the background color

turtle.bgcolor("black")

# make spiral_web

for x in range(200):

t.pencolor(colors[x%6]) # setting color

t.width(x/100 + 1) # setting width

t.forward(x) # moving forward

t.left(59) # moving left

turtle.done()

t.speed(10)


turtle.bgcolor("black") # changes the background color

# make spiral_web

for x in range(200):

t.pencolor(colors[x%6]) # setting color

t.width(x/100 + 1) # setting width

t.forward(x) # moving forward

t.left(59) # moving left

turtle.done()

0 comments on commit eaba6ea

Please sign in to comment.