请问这个turtle库花瓣是怎么画的啊?

img
就是这个梅花瓣的渐变色这种,有知道的吗?原视频图在这个网站里面

参考下这个代码

import turtle

turtle.hideturtle()#隐藏小海龟
turtle.speed(0)
turtle.colormode(255)

for j in range(5):
    for i in range(1,100):
        c = (255,int(255/100*i),int(255/100*i))
        turtle.fillcolor(c)
        turtle.pencolor(c)
        turtle.up()
        turtle.goto(0,0)
        turtle.down()
        turtle.begin_fill()
        turtle.circle(100-i)
        turtle.end_fill()
    turtle.right(72)

turtle.done()

img

如有帮助,望采纳!谢谢! 点击我这个回答右上方的【采纳】按钮

#画椭圆弧
color=0,0,0
Rect=220,50,200,200#用来限制弧线的矩形
tart_angle=0#设置弧线的起始角度
stop_angle=math.pi#结束角度
pygame.draw.arc(screen,color,Rect,tart_angle,stop_angle,width=1)
pygame.display.update() # 更新
用不同角度画多个圆弧就可以啦,希望可以帮到你