Monday, October 17, 2022

Python Turtle Graphics Design #1

Python Turtle Graphics Design #1

Youtube

code:

import turtle as t
import colorsys as cs

def donut(r1,r2,c):
    for i in range(360//5):
        t.pencolor(c)
        t.fd(r1)
        t.down()
        t.circle(r2,360)
        t.up()
        t.backward(r1)
        t.lt(5)


t.setup(500,500)
t.tracer(100,0)
t.tracer(1)
t.speed(0)
t.bgcolor('black')
t.up()
for i in range(10):
    donut(200-i*20,50-i*5+1,cs.hls_to_rgb(i/25,0.5,1))

t.done()



No comments:

Post a Comment

Python Turtle Graphics Drawing - Gigabyte

 Python Turtle Graphics Drawing - Gigabyte Youtube Source code: from turtle import * setup ( 600 , 600 ) color ( '#2D68AE' ) up (...