Refactor repository structure for clarity and professionalism

- Move scripts to tools/ directory
- Rename pyton.py to generate_swatches.py
- Rename down.py to downscale_colors.py
- Remove hardcoded API key from generate_swatches.py
- Update README.md to reference local color assets instead of placeholders
This commit is contained in:
Marco Gallegos
2026-01-20 12:25:08 -06:00
parent 9743edab4b
commit 939e62ee77
8 changed files with 78 additions and 5 deletions

25
tools/downscale_colors.py Normal file
View File

@@ -0,0 +1,25 @@
from PIL import Image
import os
# =========================
# CONFIGURACIÓN
# =========================
INPUT_DIR = "assets/colors"
OUTPUT_SIZE = (32, 32) # cambia a (24, 24) si lo prefieres
SUPPORTED_EXTENSIONS = (".png", ".jpg", ".jpeg", ".webp")
# =========================
# DOWNSCALE
# =========================
for filename in os.listdir(INPUT_DIR):
if filename.lower().endswith(SUPPORTED_EXTENSIONS):
path = os.path.join(INPUT_DIR, filename)
with Image.open(path) as img:
img = img.convert("RGB")
img = img.resize(OUTPUT_SIZE, Image.Resampling.LANCZOS)
img.save(path, optimize=True)
print(f"Downscaled {filename} to {OUTPUT_SIZE[0]}x{OUTPUT_SIZE[1]}")