In this tutorial we will learn how to change the background color of Tkinter window.
Color names for tkinter. I understand now that tkinter is only an interface to a native GUI so not all its features are accessible via python. Is it possible to translate all those colors into their hex combinations. You can also pass a standard color like red green black white etc.
Global displayed_word_color iftimer 60. Tkinter Color Code You could specify the color with the known names like red blue or green as shown above and you could also specify it via RGB like hex color codes in. The ones I know about already are Red FF0000 Yellow FFFF00 Green 00FF00 Cyan 00FFFF Blue 0000FF Magenta FF00FF White FFFFFF and.
For example fff is white 000000 is black 000fff000 is pure green and 00ffff is pure cyan green plus blue. Following are the different types of color values that you can provide to fg option. Neither foreground color nor background color can be added.
There are numerous valid color names including. Import Tkinter module. Foreground or fg is the option that accepts the color input from the user and sets the font or text color.
In this game player has to enter color of the word that appears on the screen and hence the score increases by one the total time to play this game is 30 seconds. Looking at the standard PythonTclTk sources does not show any of those colors. Red orange yellow green blue purple Many of the HTML color names work with Tkinter.
Kinnla Jul 23 16 at 1935. Create the main window. Text widgets have advanced options for editing a text with multiple lines and format the display settings of that text example font text color background color.