टिंकर में कई अंतर्निहित विशेषताएं और विशेषताएं हैं जो एप्लिकेशन डेवलपर को एक मजबूत और विशेष रुप से प्रदर्शित एप्लिकेशन बनाने में मदद करती हैं। हम टिंकर में कॉन्फ़िगरेशन विधि का उपयोग करके पृष्ठभूमि रंग, अग्रभूमि रंग, और विजेट के अन्य गुणों जैसी विशेषताओं को सेट कर सकते हैं।
किसी विजेट का पृष्ठभूमि रंग या अग्रभूमि रंग सेट करने के लिए, हम डिफ़ॉल्ट और RGB रंग कोड दोनों का उपयोग कर सकते हैं। RGB को 6 अंकों के अल्फ़ान्यूमेरिक वर्ण द्वारा परिभाषित किया गया है जिसमें R, G, B मान के विभिन्न अंक हैं। tkinter में RGB रंग कोड का उपयोग करने के लिए, हमें इसे #aab123. प्रारूप का उपयोग करके परिभाषित करना होगा।
उदाहरण
# Import the required libraries
from tkinter import *
from tkinter import ttk
# Create an instance of tkinter frame
win = Tk()
# Set the size of the tkinter window
win.geometry("700x350")
# Configure the color of the window
win.configure(bg='#65A8E1')
# Define the style for combobox widget
style = ttk.Style()
style.theme_use('xpnative')
# Define an event to close the window
def close_win(e):
win.destroy()
# Add a label widget
label = ttk.Label(win, text="Eat, Sleep, Code and Repeat", font=('Times New Roman italic', 22), background="black", foreground="white")
label.place(relx=.5, rely=.5, anchor=CENTER)
win.mainloop() आउटपुट
उपरोक्त कोड को निष्पादित करने से कुछ अनुकूलित पृष्ठभूमि रंग वाली एक विंडो प्रदर्शित होगी।

अब, विंडो की पृष्ठभूमि का रंग बदलने के लिए एक नया रंग कोड खोजें।