tkinter.colorchooser --- 顏色選擇對話框

原始碼:Lib/tkinter/colorchooser.py


The tkinter.colorchooser module provides the Chooser class as an interface to the native color picker dialog. Chooser implements a modal color choosing dialog window. The Chooser class inherits from the Dialog class.

class tkinter.colorchooser.Chooser(master=None, **options)
tkinter.colorchooser.askcolor(color=None, **options)

建立一個顏色選擇對話框。一旦呼叫這個方法便會顯示視窗,等待使用者做出選擇後,回傳選擇的顏色(或者是 None)給呼叫者。

也參考

tkinter.commondialog 模組

Tkinter 標準對話框模組