from tkinter import *
from tkinter.ttk import *
from tkinter import ttk
root = Tk()
stl = ttk.Style()
stl.map('C.TButton',
foreground = [('pressed','red'),('active','blue')],
background = [('pressed','!disabled','black'),('active','white')]
)
#background not changing.It is still grey
ttk.Button(root, text='This is a button', style='C.TButton').pack()
root.mainloop()
I tried Using style class and made some changes in C.TButton, but it seems that it is just changing the border color instead of changing the colour of button. The Button remains grey and flat help!