turtle画简笔画---便便

最近开始学习turtle绘图记录一下,自己找了个图片,练练手。
流行渐变色:
在这里插入图片描述
程序如下:

import turtle as t

t.pensize(5)  # 画笔粗细
t.speed(11)   # 画笔速度
t.colormode(255)  # r,g,b画画模式
color = 255
step = 15
for i in range(300, 10, -10):
    if(color >= step):
        color = color - step
    else:
        color = 0
    t.color((255, color, 255))  # 画笔颜色
    t.penup()    # 抬起画笔
    t.goto(0, -i)  # 移动画笔到定点
    t.pendown()    # 落下画笔
    t.circle(i)   # 画圆
t.mainloop()      # 事件循环

简笔画–便便
在这里插入图片描述
程序如下:

'''
Created on Jan 23, 2020
@author: kun
'''
import turtle as t


def skip(step):
    t.penup()
    t.forward(step)
    t.pendown()


def skip_point(x, y):
    t.penup()
    t.goto(x, y)
    t.pendown()


t.colormode(255)  # r,g,b画画模式
t.speed(3)
t.right(90)
skip(-200)
t.right(-30)
t.color((255, 215, 0))  # 画笔颜色
t.pensize(8)
# 第一个
t.fillcolor("yellow")
t.begin_fill()
t.circle(-40, 130)
t.right(-10)
t.circle(50, 180)
t.forward(35)
skip(30)
t.forward(35)
t.circle(50, 180)
t.circle(-60, 90)
t.end_fill()
#########################
t.right(-90)
skip(90)
t.left(90)
skip(130)
t.right(80)
# 第二个
# t.fillcolor("pink")
# t.begin_fill()
t.circle(55, 170)
t.forward(80)
skip(20)
t.forward(90)
t.circle(55, 180)
#########################
skip(240)
t.left(90)
skip(80)
t.right(80)
#  第三个
t.circle(65, 180)
t.right(10)
t.forward(270)
t.circle(65, 180)
t.end_fill()
#########################
t.mainloop()
纯属娱乐

  • 0
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值