
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
- Python Advanced Tutorial
- Python - Classes/Objects
- Python - Reg Expressions
- Python - CGI Programming
- Python - Database Access
- Python - Networking
- Python - Sending Email
- Python - Multithreading
- Python - XML Processing
- Python - GUI Programming
- Python - Further Extensions
- Python Useful Resources
- Python - Questions and Answers
- Python - Quick Guide
- Python - Tools/Utilities
- Python - Useful Resources
- Python - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Python - Tkinter Colors
Tkinter represents colors with strings. There are two general ways to specify colors in Tkinter −
You can use a string specifying the proportion of red, green and blue in hexadecimal digits. For example, "#fff" is white, "#000000" is black, "#000fff000" is pure green, and "#00ffff" is pure cyan (green plus blue).
You can also use any locally defined standard color name. The colors "white", "black", "red", "green", "blue", "cyan", "yellow", and "magenta" will always be available.
Color options
The common color options are −
activebackground − Background color for the widget when the widget is active.
activeforeground − Foreground color for the widget when the widget is active.
background − Background color for the widget. This can also be represented as bg.
disabledforeground − Foreground color for the widget when the widget is disabled.
foreground − Foreground color for the widget. This can also be represented as fg.
highlightbackground − Background color of the highlight region when the widget has focus.
highlightcolor − Foreground color of the highlight region when the widget has focus.
selectbackground − Background color for the selected items of the widget.
selectforeground − Foreground color for the selected items of the widget.