πŸ–ΌοΈ

Color Palette Generator

Extract dominant colors from images and export as design palettes (HEX, RGB, CSS variables).

Image ⭐⭐ Intermediate ⏱️ 3 minutes

😫 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:

  1. Extract: Get the 6 most dominant colors.
  2. Output Formats:
    • Print as HEX codes.
    • Save as palette.json with HEX and RGB values.
    • Save as palette.css with CSS custom properties.
  3. 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

  1. Install: pip install colorthief
  2. Copy Prompt β†’ Run.

Related Workflows

Explore other categories

πŸ“¬

Get Started with Agentic Working

Subscribe to receive updates from AgenticWorking.io

πŸ“– Free eBook Guide πŸ“¦ 7 Ready-to-use Scripts πŸ”” Weekly Tips

No spam, unsubscribe anytime. Join 1,000+ subscribers.