tkinter.colorchooser.askcolor(color=None, **options)
实例
import tkinter.colorchooser as tc
import tkinter as tk
root = tk.Tk()
root.geometry('600x400')
def show():
c = tc.askcolor() # 返回的是元组
root.config(bg=c[1])
btn = tk.Button(root,text='select color',command=show).pack()
root.mainloop()
网友评论