π« The Pain Point
Youβre designing a website and want colors that match the hero image. Manually picking colors with an eyedropper is tedious and often misses the best combinations.
π Agentic Solution
An Automatic Palette Extractor that finds the most visually important colors in any image.
Key Features:
- Dominant Colors: Extracts 5-10 most prominent colors.
- Export Formats: HEX, RGB, HSL, CSS variables.
- Batch Mode: Process multiple images for brand consistency.
βοΈ Phase 1: Commander (Quick Fix)
For quick palette extraction.
Prompt:
βI have an image
hero.jpg. Write a Python script using colorthief to:
- Extract: Get the 6 most dominant colors.
- Output Formats:
- Print as HEX codes.
- Save as
palette.jsonwith HEX and RGB values.- Save as
palette.csswith CSS custom properties.- Visual: Create a color swatch image (600x100px).
For batch mode, accept a folder path and process all images.β
Result: Ready-to-use color palettes for design.
ποΈ Phase 2: Architect (Permanent Tool)
For Designers.
Engineering Prompt:
**Role:** Python Tool Developer
**Task:** Create a "Color Palette Generator".
**Requirements:**
1. **GUI:**
* Select image or folder.
* Number of colors slider (3-12).
* Export format checkboxes (JSON, CSS, Image).
* Preview palette in app.
2. **Logic:**
* Use colorthief or custom k-means clustering.
* Sort by prominence or hue.
* Generate complementary colors.
3. **Deliverables:**
* `palette_gen.py`
* `run.bat`, `run.sh`
* `requirements.txt`
π§ Prompt Decoding
- Color Thief: Uses k-means clustering to find clusters of similar pixels, returning the βaverageβ color of each cluster.
π οΈ Instructions
- Install:
pip install colorthief - Copy Prompt β Run.