0

I am trying to get 5 color inputs from the user and display them in blocks using waffle, but the colorchooser runs only once and the code is stuck after closing the colorchooser.

import matplotlib.pyplot as plt
from pywaffle import Waffle
from tkinter import colorchooser

colors_list = []
for i in range(1,6):
    color_code = colorchooser.askcolor(title ="Choose color"+str(i))
    colors_list.append(color_code[1])
    print(colors_list)
fig = plt.figure(
    FigureClass= Waffle,
    rows = 1, columns= 5,
    values = [1,1,1,1,1],
    colors=colors_list,
    title = {"label": "Home Color Scheme", "loc": "center", "size": 20}
)
plt.show()

I tried to ask the user using multiple variables and without using loops as well.

Prixya
  • 1
  • 3

0 Answers0