tkinter button background color code example

Example 1: tkinter button background color mac

#Use highlightbackground=color
#For example:

submit = Button(root, text="Generate", highlightbackground='#3E4149')

Example 2: how to change button background color while clicked tkinter python

#Type "activebackground=" + your chosen background color between commas
col = Button(yourWindow, text='col', bg='gray25', activebackground='cyan')

Example 3: change color of butto in thkinter

button = Button(tkWindow, bg='blue')
button = Button(tkWindow, bg='black')
button = Button(tkWindow, bg='white')
button = Button(tkWindow, bg='red')
#hex values
button = Button(tkWindow, bg='#54FA9B')
button = Button(tkWindow, bg='#A877BA')

Example 4: gui button in tkinter color

import Image as PIL
import ImageTk