turtle graphics design python
download pydroid 3 app
go to terminal install colorsys Module
from turtle import * # initialize all from turtle library (* indicate all property)
import colorsys # another library which includes different colors
speed(0) #turtle speed
hideturtle() # hide turtle movement
hue =0.0 # variable
bgcolor('black') #turtle background blcak (if you want change it to other color)
for i in range(95): #number of moves in turtle(if you want make change the value)
color=colorsys.hsv_to_rgb(hue,1,1) # color is the variable,it stores the values of colorsys module,hue
pencolor(color) # swap the color with turtle
hue+=0.005 # here changes different colors
for j in range(17): # for loop number of moves
fd(0.2*i*j) # forward turtle with value
lt(33/0.01) # move left with value
done() #stop the turtle
-----------------------------------------------------------------------------------------------------------------------------
without any color:
from turtle import *
speed(0)
for i in range(95):
for j in range(17):
fd(0.2*i*j)
lt(33/0.01)
done()
Comments
Post a Comment