title: How to change background color in ttk python
body: <p>I've made a simple gui age converter app but i want to change its bg color to black.
  The problem is in the ttk frame.i don't know how to configure its bg color.
  I have tried different methods but that didn't work.
  i would be grateful if you guys could help.
  here is the code</p>
  
  <pre><code>from tkinter import *
  from tkinter import ttk
  from PIL import Image
  
  
  
  
  def calculate(*args):
          try:
              age_sec = int(age.get())
              age_sec = age_sec * 12 * 365 * 24 * 60 * 60
              age_seconds.set(age_sec)
          except:
              age_seconds.set('Either the field is empty or \n value is not numeric.')
  
  root = Tk()
  root.title("Converter")
  root.configure(background="black")
  mainframe = ttk.Frame(root, padding = "6 6 12 12")
  mainframe.grid(column = 0, row = 0, sticky = (N, W, E, S))
  mainframe.columnconfigure(0, weight = 1)
  mainframe.rowconfigure(0, weight = 1)
  
  #mainframe['borderwidth'] = 2
  #mainframe['relief'] = 'groove'
  
  age = StringVar()
  age_seconds  = StringVar()
  
  ttk.Label(mainframe,  foreground = "#4D4E4F", text = "Enter your Age: ").grid(column = 1, row = 1, sticky = E)
  age_entry = ttk.Entry(mainframe, width = 30, textvariable = age)
  age_entry.grid(column = 2, row = 1, sticky = (W, E))
  
  ttk.Label(mainframe, foreground = "#4D4E4F", text = "your age in seconds is ").grid(column = 1, row  = 2, sticky = (E))
  
  ttk.Label(mainframe, textvariable = age_seconds, background = "lightyellow", foreground = "#727475", width = 30).grid(column = 2, row  = 2, sticky = W)
  
  
  #Mouse Events...\\
  
  butt_image = PhotoImage(file = 'images.gif')
  ttk.Button(mainframe, compound = TOP, text = "Hit Now", image =butt_image,  cursor = "hand2", width= 30, command = calculate).grid(column = 2, row  = 4,  sticky = W)
  l2 = ttk.Label(mainframe,foreground = "#4D4E4F", text = "Mouse Events: ").grid(column = 1, row = 3, sticky = E)
  l = ttk.Label(mainframe,background = "lightyellow", foreground = "#727475", text = 'Measurement is starting...', width = 30)
  l.grid(column = 2, row = 3, sticky = W)
  l.bind('&lt;Enter&gt;', lambda e: l.configure(text = 'Moved Mouse Inside'))
  l.bind('&lt;Leave&gt;', lambda e: l.configure(text = 'Mouse Moved Out'))
  l.bind('&lt;1&gt;', lambda e: l.configure(text = 'left Mouse clicked'))
  l.bind('&lt;Double-1&gt;', lambda e: l.configure(text = 'Double clicked'))
  l.bind('&lt;B1-Motion&gt;', lambda e: l.configure(text = 'Left button drag to %d, %d' %(e.x, e.y)))
  image = PhotoImage(file = 'waves.gif')
  ttk.Label(mainframe, compound = CENTER, text = "Image text", font = ('roman', 9, 'normal'), foreground ='green', image = image).grid(column = 3, row = 1, sticky = (N, E))
  #if '__name__' == '__main__':
  for child in mainframe.winfo_children(): child.grid_configure(padx = 15, pady =  15)
  age_entry.focus()
  root.bind('&lt;Return&gt;', calculate)
  root.mainloop()
  </code></pre>