Python漂亮的荷花类图形

Python漂亮的荷花类图形,本程序使用了tracer命令,不会演示绘画过程,所以绘画速度极快www.lixingqiu李兴球

"""Python漂亮的荷花类图形,本程序使用了tracer命令,不会演示绘画过程,所以绘画速度极快
本程序用到了coloradd模块,可以从pip install coloradd安装
"""

import turtle
from coloradd import *

def drawlotus(d):
    color = (1,0,0)    
    for k in range(20):
        for _ in range(2):
            for i in range(10):            
                turtle.pencolor(color)
                turtle.fd(d)
                turtle.left(9)
                color = coloradd(color,0.01)
            turtle.left(90)
            
        turtle.left(18)
        
screen = turtle.getscreen()       # 获取屏幕对象
screen.bgcolor("black")           # 设置屏幕背景
screen.delay(0)                   # 设置绘画延时 
screen.setup(480,360)             # 设置画布大小
screen.title("Python漂亮的荷花类图形www.lixingqiu.com")

turtle.ht()                       # 隐藏海龟
turtle.speed(0)                   # 设置速度 
turtle.pencolor("blue")           # 画笔颜色 
turtle.setheading(180)            # 海龟方向
turtle.pensize(4)                 # 画笔大小

You must log in to read the rest of this article. Please log in or register as a user.