代码点读机 / Python / turtle.color

turtle.color Python · 模块功能

设置画笔和填充颜色。

怎么用

import turtle
turtle.color(c)

小例子

import turtle
turtle.color('red')
print('颜色设为 red')

运行结果

颜色设为 red

提醒:可用颜色名或十六进制。

官方文档:https://docs.python.org/zh-cn/3/library/turtle.html#turtle.color

在代码里遇到不认识的词?打开代码点读机,点一下就懂 → ← Python全部词条