Hello everyone, In this tutorial, you will learn how to bring color chooser using Tkinter in Python. The example program has been tested and shared in the same post.
Example Program
import tkinter as tk<br> from tkinter.colorchooser import * #defining get_color function def get_color():<br> color = askcolor()<br> print(color) #creating an instance for Tk root = tk.Tk()<br> root.title("Color Chooser") btn = tk.Button(text='Select Color', command=get_color)<br> btn.pack() #starting an application root.mainloop()
Output
((160.625, 160.625, 160.625), '#a0a0a0')

More from my site
Hello, folks, I am a founder of dineshkrish.com. I love Java and Open source technologies, If you find my tutorials are useful, please consider making donations to these charities.