tkinter.colorchooser — 색상 선택 대화 상자

소스 코드: Lib/tkinter/colorchooser.py


tkinter.colorchooser 모듈은 네이티브 색상 선택기 대화 상자의 인터페이스로 Chooser 클래스를 제공합니다. Chooser는 모달(modal) 색상 선택 대화 상자 창을 구현합니다. Chooser 클래스는 Dialog 클래스를 상속합니다.

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

The class implementing the modal color-choosing dialog. Most applications use the askcolor() convenience function rather than instantiating this class directly.

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

Show a modal color-choosing dialog and return the chosen color. color is the color selected when the dialog opens. The return value is a tuple ((r, g, b), hexstr), where r, g and b are the red, green and blue components as integers in the range 0–255 and hexstr is the equivalent Tk color string, such as '#ff8000'. If the user cancels the dialog, (None, None) is returned.

버전 3.10에서 변경: The RGB values in the returned color are now integers in the range 0–255 instead of floats.

더 보기

모듈 tkinter.commondialog

Tkinter 표준 대화 상자 모듈