from tkinter import *
tk = Tk()
tk.title("Kaint")
canvas = Canvas(tk, width=500, height=500)
canvas.pack()
color = input("What Color?")
size = float(input("Size?"))
def cc(event):
color = input("What Color?")
def paint(event):
x, y = event.x, event.y
print('{}, {}'.format(x, y))
x1 = event.x - size
y1 = event.y - size
x2 = event.x + size
y2 = event.y + size
canvas.create_oval(x1, y1, x2, y2, fill=color, outline=color)
canvas.bind_all("<Button-3>", cc)
canvas.bind_all("<B1-Motion>", paint)
while True:
tk.update_idletasks()
tk.update()
mainloop()
如何更改我的钢笔工具颜色(绘画功能)?我需要它来更新,因为它具有将 var 颜色更改为不同颜色的功能