Im trying to make it so on my (basic) tkinter program there is a button that changes the colors in order of a list, using a button, but when the button is pressed, nothing happens. Thoughts?
color = ['#65368c', '#279ffe', '#db4b4b', '#002a28']
coloriter = iter(color)
colorintk = str(next(coloriter))
root = tk.Tk()
root['background'] = colorintk
myFont = font.Font(family='comic sans')
random_button = tk.Button(root, text='Generate new name', command=random_name, bg=colorintk, font=myFont, )
random_button.pack()
color_button = tk.Button(root, text='New Color', command=next(coloriter), bg=colorintk, font=myFont, )
color_button.pack()
w = tk.Label(root, text=(random.choice(names) + " " + random.choice(names)), bg=colorintk, font=myFont)
w.pack()
root.geometry("640x640")
tk.mainloop()
note that there is more code which is what the random name and name variables are.