An Interest In:
Web News this Week
- April 26, 2024
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
February 21, 2022 05:38 pm GMT
Original Link: https://dev.to/kavehsabouri/how-to-make-a-color-chooser-in-tkinter-with-python-48ob
How to make a Color chooser in python with tkinter.
`#Kaveh Sabouri
from tkinter import *
from tkinter import colorchooser
window=Tk()
window.title("Color chooser")
window.geometry("500x500")
window.config(bg="lavender")
def choose():
color=colorchooser.askcolor()
colorHex=color[1]
window.config(bg=colorHex)
la243=Label(text="Your Hex color is:",font=("Lalezar",25),bg=colorHex)
la243.place(x=60,y=20)
lco=Label(window,text=colorHex,font=("Lalezar",25),bg=colorHex)
lco.place(x=300,y=20)
btn1=Button(text="Chosse color",font=("",23),bg="#fc8803",command=choose)
btn1.place(x=145,y=224)
window.mainloop()`
Original Link: https://dev.to/kavehsabouri/how-to-make-a-color-chooser-in-tkinter-with-python-48ob
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To