diff --git a/README.md b/README.md index 696cbfa..d621688 100644 --- a/README.md +++ b/README.md @@ -139,11 +139,11 @@ Nunca gestual. Nunca decorativa. | Swatch | Nombre | Hex | | ------------------------------------------------------------ | -------------- | --------- | -| ![#F6F1EC](https://via.placeholder.com/24/F6F1EC/F6F1EC.png) | Bone White | `#F6F1EC` | -| ![#EFE7DE](https://via.placeholder.com/24/EFE7DE/EFE7DE.png) | Soft Cream | `#EFE7DE` | -| ![#B8A89A](https://via.placeholder.com/24/B8A89A/B8A89A.png) | Mocha Taupe | `#B8A89A` | -| ![#6F5E4F](https://via.placeholder.com/24/6F5E4F/6F5E4F.png) | Deep Earth | `#6F5E4F` | -| ![#3F362E](https://via.placeholder.com/24/3F362E/3F362E.png) | Charcoal Brown | `#3F362E` | +| ![Bone White](assets/colors/bone-white.png) | Bone White | `#F6F1EC` | +| ![Soft Cream](assets/colors/soft-cream.png) | Soft Cream | `#EFE7DE` | +| ![Mocha Taupe](assets/colors/mocha-taupe.png) | Mocha Taupe | `#B8A89A` | +| ![Deep Earth](assets/colors/deep-earth.png) | Deep Earth | `#6F5E4F` | +| ![Charcoal Brown](assets/colors/charcoal-brown.png) | Charcoal Brown | `#3F362E` | Uso contenido. Sin saturación. Sin gradientes. diff --git a/assets/colors/bone-white.png b/assets/colors/bone-white.png new file mode 100644 index 0000000..1cae5c7 Binary files /dev/null and b/assets/colors/bone-white.png differ diff --git a/assets/colors/charcoal-brown.png b/assets/colors/charcoal-brown.png new file mode 100644 index 0000000..c95d7f3 Binary files /dev/null and b/assets/colors/charcoal-brown.png differ diff --git a/assets/colors/deep-earth.png b/assets/colors/deep-earth.png new file mode 100644 index 0000000..5394c19 Binary files /dev/null and b/assets/colors/deep-earth.png differ diff --git a/assets/colors/mocha-taupe.png b/assets/colors/mocha-taupe.png new file mode 100644 index 0000000..015d1b8 Binary files /dev/null and b/assets/colors/mocha-taupe.png differ diff --git a/assets/colors/soft-cream.png b/assets/colors/soft-cream.png new file mode 100644 index 0000000..f67e73c Binary files /dev/null and b/assets/colors/soft-cream.png differ diff --git a/tools/downscale_colors.py b/tools/downscale_colors.py new file mode 100644 index 0000000..6b878eb --- /dev/null +++ b/tools/downscale_colors.py @@ -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]}") + diff --git a/tools/generate_swatches.py b/tools/generate_swatches.py new file mode 100644 index 0000000..595f7d9 --- /dev/null +++ b/tools/generate_swatches.py @@ -0,0 +1,48 @@ +from openai import OpenAI +import base64 +import os + +# ========================= +# CONFIGURACIÓN API +# ========================= +# Set OPENAI_API_KEY as environment variable or replace below +OPENAI_API_KEY = os.getenv("OPENAI_API_KEY") +if not OPENAI_API_KEY: + raise ValueError("OPENAI_API_KEY environment variable not set") +client = OpenAI(api_key=OPENAI_API_KEY) + +# ========================= +# CONFIGURACIÓN +# ========================= +SIZE = "1024x1024" # Tamaño válido +OUTPUT_DIR = "assets/colors" + +COLORS = { + "bone-white": "#F6F1EC", + "soft-cream": "#EFE7DE", + "mocha-taupe": "#B8A89A", + "deep-earth": "#6F5E4F", + "charcoal-brown": "#3F362E", +} + +PROMPT_TEMPLATE = ( + "A flat square color swatch, solid fill, hex color {hex}. " + "No gradients, no texture, no shadow, no border. " + "Minimal, neutral, technical style." +) + +os.makedirs(OUTPUT_DIR, exist_ok=True) + +for name, hex_color in COLORS.items(): + prompt = PROMPT_TEMPLATE.format(hex=hex_color) + + result = client.images.generate(model="gpt-image-1", prompt=prompt, size=SIZE) + + image_base64 = result.data[0].b64_json + image_bytes = base64.b64decode(image_base64) + + output_path = os.path.join(OUTPUT_DIR, f"{name}.png") + with open(output_path, "wb") as f: + f.write(image_bytes) + + print(f"Generated {output_path}")