Python GUI Tutorial - 43 - Colorchooser - color dialog

preview_player
Показать описание
in this video, you will learn how we can use colorchooser dialog in tkinter application. So here we'll learn how we pop up a window of colorchooser and pick a color and use it in our program. Color chooser will return the values in the form of tupple. there will be two values in tuple first one is the RGB value of the selected color and second one is the hex color code of selected color from colorchooser.

here is the code used in this video-

from tkinter import *
from tkinter import colorchooser

def call_me():

root = Tk()

button = Button(root, text="change color", command=call_me)

-------------------------------------

so i am sure your queries like-
2. how to use selected color from color dialogbox in tkinter?
3. how to change root window color on run time in tkinter?
4. how to change color of any widget in tkinter?
5. how to set color in hex code in tkinter?
6. how to get RGB value from colorchooser dialogbox in tkinter?

have been solved.

if you have any problem related with this video, then please let us know in commentbox. we'll reply as soon as possible.

contact us -

Рекомендации по теме
Комментарии
Автор

i dont understand hindi but you got a new subscriber brother

borgyoh
Автор

did not understand a word except 'bye bye'

johnpro
Автор

Sir first of all let me say your this series is the best series on Python Tkinter generally and specially in Hindi/Urdu on whole you-tube.
Sir can you please guide towards some easy and free reading material for learning python Tkinter ?
Thanks and Regards.

zeeshanakram
Автор

Is it possible to assign each of the rgb values to a variable?

oskar
Автор

I commented on my other account lol. Anyway, how do you pass a value from the tuple that choosing the color makes. How do I get the output into another function, clr[1] doesn't work with retun at the end of the class def, I just want to pass the RGB or the HEX to draw a line or somehow fill the backround of a frame or even window, or show color on a canvas somehow. I cannot get the tuple or a value of it to pass to anything else? Thanks for the video, I hadn't known colorchooser existed, but it's great as soon as I can figure out more/learn and understand more about class' and python in general, I tried an if statment just asking if clr and then one of the value in [ ] was larger than 0 to just print something, and I cannot get that to work, like

I tried an if statment
if clr[1] > 0:
print('I have color')

even doing that after putting return instead of print, and trying to even return the specific value I look for, I suppose it's because it's not in the correct name space and clr isn't a global variable, or at least not a variable for the tuple that is printed. So I need to give that tuple a variable somehow, and make it global. I thought of putting a letter or even clr and set it equal to something before the def, however did not work.

IDK why there is such a lack of work on this method, function, whatever. I'm just now trying to understand classes and functions, really anything you define. If I could figure this out I would understand a lot more. I have learned so much, and about so many other things, I feel like once I understand creating classes and methods/functions I will be 1000 time better than I am right now.

drmayne
Автор

sir kya python seekhne ke baad secure job mil skti hai kis field mein zyada scope hai pls bataye sir samajh mein nhi aa rha. Sir library or framework mein kya difference hai aur sir inka use kha aur kaise karte hai

shubhamarora
Автор

dear sir thansk for video, muchye root1 one say taxt puchye root2 or root3 per or photo bhi kaya karna ho ga sir pls tell me sir

gauravSingh-wsum
Автор

Back ground color set nhi huwa to essmen none return hoga to vo kese hoga

Anujasrk