Color Picker - Python Tkinter GUI Tutorial #49

preview_player
Показать описание
In this video I'll show you how to use the tkinter color picker, or color chooser as it's actually called, to pick colors for your tkinter app.

Need to use colors in your app? Want your user to be able to select a color themselves? You need the colorchooser widget!

In this video I'll show you how to use it. Its pretty easy!
Рекомендации по теме
Комментарии
Автор

Just subscribed. Well done John. These are really punch to the point videos and are the best I've seen. Thank you

grahamehambleton
Автор

Dear John! It is amazing! It does not matter what I am looking for to realize with tkinter, you have the right video tutorial! I cannot thank you enough for your highly supportive videos! Allways to the point and understandable! All the best my friend!

stefanosstavroulis
Автор

▶️ Watch Entire Tkinter Playlist ✅ Subscribe To My YouTube Channel:
▶️ See More At: ✅ Join My Facebook Group:

Codemycom
Автор

one suggestion
first of all pip install pyperclip

import pyperclick

and then make a button, when clicked on that it will copy that color code and user can use that in their project

syntax,
pyperclip.copy(text)

: )
hope it will help you .

vanshatcode
Автор

Thank you Jhon!
For the import thing I guess that they are not the same that's why we type them both:
*) 1st import: 'from tkinter import *' means from the module tkinter.py import all the functions that are defined inside that module
*) 2nd import: 'from tkinter import colorchooser' means from the folder tkinter import the module colorchooser.py and inside that colorchooser.py module there is this function 'askcolor( )' so in order to use it we type 'colorchooser.askcolor( )'
So in conclusion the first tkinter is a miodule and the second one is a folder.. I hope I am not mistaken :)

whitebird
Автор

that was really fun. small side note. do not use pack() when creating a widget. had some issues with the one-liner-approach

JackPillawa
Автор

Hi! Thank you for good tutorial. 😀 Can I make the color wheel with python GUI(like the color panel of Photoshop)? Do I have to use 'matplotlib' to do it? I wanna display HSB wheel in my web application!

hady.uncolored
Автор

7:40 the 1th item... is that really the right way to say that in this context?

marknewton
Автор

how can i have a bg value on main and the def of choosecolor updates the bg value on main with the color we chose
what i mean is that the window will have a default background (black is what i choose) and then pressing the button will let me choose another color.
how can i return that picked color into main function

DarkSpeedKiller
Автор

how do you use color chooser to replace the label with the new color instead of creating a new one each time color chooser is called?

masonschmidt
Автор

How can I change the UI color of the color picker panel

johnkabwebwe
Автор

Dear John! can help me

The problem is I want to cut and paste the hex code
but that doesn't work (nice and easy for html css programming)

from tkinter import *
from tkinter import colorchooser
windows = Tk()
windows.title("color")
windows.geometry("200x100")

defcolor():
my_color = colorchooser.askcolor()[1]
my_label = Label(windows, text=my_color).pack(pady=10)

my_button = Button(windows, text="color",
width=10, height=1, command=color).pack()


windows.mainloop()
he puts in a label
and if I insert my_color then
and some kind of label hack doesn't work either
keep in mind you are making a fake label.


Google Translate

andrewzweden
Автор

so in my code if i dont select a colour, i get an error in the console. code is
def color():
my_color = colorchooser.askcolor()

nikaman
Автор

Hey, what if I want to change the fg and de bg in the same Label?

fgstrencher
Автор

when I am clicking on the button, my tkinter window closes

devenjain