Tkinter Colour Selector

[Solved] Tkinter Colour Selector | Php - Code Explorer | yomemimo.com
Question : tkinter colour selector

Answered by : christo-kruger-rui0bwz77lnm

# Python program to create color chooser dialog box
 
# importing tkinter module
from tkinter import *
 
# importing the choosecolor package
from tkinter import colorchooser
 
# Function that will be invoked when the
# button will be clicked in the main window
def choose_color():
 
    # variable to store hexadecimal code of color
    color_code = colorchooser.askcolor(title ="Choose color")
    print(color_code)
 
root = Tk()
button = Button(root, text = "Select color",
                   command = choose_color)
button.pack()
root.geometry("300x300")
root.mainloop()

Source : https://www.geeksforgeeks.org/python-tkinter-choose-color-dialog/ | Last Update : Sat, 13 Aug 22

Answers related to tkinter colour selector

Code Explorer Popular Question For Php