Update app.py
Browse files
app.py
CHANGED
@@ -1,14 +1,10 @@
|
|
1 |
-
import
|
2 |
-
|
3 |
-
import os
|
4 |
-
import zipfile
|
5 |
-
import tempfile
|
6 |
-
import shutil
|
7 |
|
8 |
def recolor_icons(zip_file, hex_color):
|
9 |
-
#
|
10 |
-
|
11 |
-
|
12 |
|
13 |
# Set up temp directories
|
14 |
temp_input_dir = tempfile.mkdtemp()
|
|
|
1 |
+
from PIL import Image, ImageColor
|
2 |
+
import os, zipfile, tempfile, shutil
|
|
|
|
|
|
|
|
|
3 |
|
4 |
def recolor_icons(zip_file, hex_color):
|
5 |
+
target_rgb = ImageColor.getrgb(hex_color) # Fixed: handles "red", "#ff0000", etc.
|
6 |
+
|
7 |
+
# Rest of the function...
|
8 |
|
9 |
# Set up temp directories
|
10 |
temp_input_dir = tempfile.mkdtemp()
|