use standard color codes with format #ff80bf or standard names red, blue, etc.
these can be displayed on any widget that allows attributes fg or bg
some examples:
these can be displayed on any widget that allows attributes fg or bg
some examples:
import tkinter as tk class Colors: def __init__(self, parent): self.initialize_window(parent) def initialize_window(self, parent): # give it some size parent.geometry("600x400+50+50") # and a title parent.title('Show your Colors') # add a frame with background color frame = tk.Frame(parent, bg='#ff80bf') frame.pack(fill=tk.BOTH, expand=1) # add a button (to frame) with different color btn = tk.Button(frame, text='Frame Button', bg='#80bfff') btn.pack() # add a button to parent with yet a different color btn1 = tk.Button(parent, text='Parent Button', bg='#ffdf80') btn1.pack() def main(): root = tk.Tk() Colors(root) root.mainloop() if __name__ == '__main__': main()results: