Spaces:
Sleeping
Sleeping
| from templates.image_template import ImageTemplate | |
| def get_two_color_template(): | |
| return ImageTemplate("images/2-color-template.png", [(0,35,87), (219,17,5)]) | |
| def get_three_color_template(): | |
| return ImageTemplate("images/3-color-template.png", [(0,35,87), (247,239,228), (219,17,5)]) | |
| def get_four_color_template(): | |
| return ImageTemplate("images/4-color-template.png", [(0,35,87), (247,239,228), (219,17,5), (62,147,48)]) | |
| def get_color_template(num_colors: int): | |
| if num_colors == 2: | |
| return get_two_color_template() | |
| elif num_colors == 3: | |
| return get_three_color_template() | |
| elif num_colors == 4: | |
| return get_four_color_template() | |
| else: | |
| raise ValueError("Number of colors must be 2, 3 or 4") |