利用pvthon自定义一个实心圆点函数至少设置两个形参:半径颜色color并将半径默认值设为20像素,画笔和填充默认颜色设为红色。另外不管传入的是英文名称,rgb小数值,rgb整数值等不同颜色模式的颜色都能利用turtle库实现不同颜色不同大小的实心圆点绘制。
然后以下是我自己写的代码,不知道为什么我的rgb的整数部分运行不了 画的线是红的 求解答
import turtle as t
def soliDot():
t.color("red")
t.colormode(255)
t.colormode(1.0)
t.setup(400,500,0,0)
t.fillcolor("black")
t.begin_fill()
t.circle(30)
t.end_fill()
t.ht()
t.penup()
t.goto(49,16)
t.pendown()
t.color()
t.begin_fill()
t.circle(50)
t.end_fill()
t.ht()
t.penup()
t.goto(70,-20)
t.pendown()
t.color(1,0,0)
t.begin_fill()
t.circle(30)
t.end_fill()
t.ht()
t.penup()
t.goto(-20,30)
t.pendown()
t.color(0,0,255)
t.begin_fill()
t.circle(57)
t.end_fill()
t.ht()
t.penup()
t.goto(-50,-12)
t.pendown()
t.dot()
t.ht()
t.penup()
soliDot()
t.done