Solution
is_dark_mode = False
def toggle_dark_mode():
global is_dark_mode
if is_dark_mode:
root.configure(background="white")
price_label.config(bg="white", fg="black")
text_label.config(bg="white", fg="black")
min_label.config(bg="white", fg="black")
min_entry.config(fg="black", bg="#F2F2F2")
max_label.config(bg="white", fg="black")
max_entry.config(fg="black", bg="#F2F2F2")
button_container.config(bg="white")
confirm_button.config(style="Round.TButton")
reset_button.config(style="Round.TButton")
is_dark_mode = False
else:
root.configure(background="#222222")
price_label.config(bg="#222222", fg="white")
text_label.config(bg="#222222", fg="white")
min_label.config(bg="#222222", fg="white")
min_entry.config(fg="white", bg="#444444")
max_label.config(bg="#222222", fg="white")
max_entry.config(fg="white", bg="#444444")
button_container.config(bg="#222222")
confirm_button.config(style="TButton", fg="white", bg="#444444")
reset_button.config(style="TButton", fg="white", bg="#444444")
is_dark_mode = True
def toggle_normal_mode():
global is_dark_mode
if is_dark_mode:
root.configure(background="#222222")
price_label.config(bg="#222222", fg="white")
text_label.config(bg="#222222", fg="white")
min_label.config(bg="#222222", fg="white")
min_entry.config(fg="white", bg="#444444")
max_label.config(bg="#222222", fg="white")
max_entry.config(fg="white", bg="#444444")
button_container.config(bg="#222222")
confirm_button.config(style="Round.TButton", fg="white", bg="#444444")
reset_button.config(style="Round.TButton", fg="white", bg="#444444")
is_dark_mode = True
else:
root.configure(background="white")
price_label.config(bg="white", fg="black")
text_label.config(bg="white", fg="black")
min_label.config(bg="white", fg="black")
min_entry.config(fg="black", bg="#F2F2F2")
max_label.config(bg="white", fg="black")
max_entry.config(fg="black", bg="#F2F2F2")
button_container.config(bg="white")
confirm_button.config(style="Round.TButton")
reset_button.config(style="Round.TButton")
is_dark_mode = False