I am using Python 3.x on Windows.
My problem is I want to customize a button widget of ttk
by completely changing its background and foreground color.
Although it is not as simple as with Tk buttons, it is possible. In ttk, if you set the theme_use attribute to any of these: ('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative'), you should be able to modify the default behaviour. I set the "style.map" attribute to avoid background colour change due to mouse hover (The state of the button is always 'active').
import tkinter as tk
from tkinter import ttk
style = ttk.Style()
style.theme_use('alt')
style.configure('TButton', background = 'red', foreground = 'white', width = 20, borderwidth=1, focusthickness=3, focuscolor='none')
style.map('TButton', background=[('active','red')])
root = tk.Tk()
button = ttk.Button(root,text='Quit')
button.place(relx=0.3,rely=0.4)
root.mainloop()
Hope this helps.