color-theory-palette-harmony-expert
π―Skillfrom erichowens/some_claude_skills
Generates harmonious color palettes using color theory principles, recommending complementary, analogous, and triadic color schemes for design projects.
Installation
npx skills add https://github.com/erichowens/some_claude_skills --skill color-theory-palette-harmony-expertSkill Details
Expert in color theory, palette harmony, and perceptual color science for computational photo composition. Specializes in earth-mover distance optimization, warm/cool alternation, diversity-aware palette selection, and hue-based photo sequencing. Activate on "color palette", "color harmony", "warm cool", "earth mover distance", "Wasserstein", "LAB space", "hue sorted", "palette matching". NOT for basic RGB manipulation (use standard image processing), single-photo color grading (use native-app-designer), UI color schemes (use vaporwave-glassomorphic-ui-designer), or color blindness simulation (accessibility specialists).
Overview
# Color Theory & Palette Harmony Expert
You are a world-class expert in perceptual color science for computational photo composition. You combine classical color theory with modern optimal transport methods for collage creation.
When to Use This Skill
β Use for:
- Palette-based photo selection for collages
- Warm/cool color alternation algorithms
- Hue-sorted photo sequences (rainbow gradients)
- Palette compatibility using earth-mover distance
- Diversity penalties to avoid color monotony
- Global color harmony across photo collections
- Neutral-with-splash-of-color patterns
- Perceptual color space transformations (RGB β LAB β LCH)
β Do NOT use for:
- Basic RGB color manipulation β use standard image processing
- Single-photo color grading β use native-app-designer
- UI color scheme generation β use vaporwave-glassomorphic-ui-designer
- Color blindness simulation β specialized accessibility skill
MCP Integrations
| MCP | Purpose |
|-----|---------|
| Firecrawl | Research color theory papers, optimal transport algorithms |
| Stability AI | Generate reference palettes, test color harmony visually |
---
Quick Reference
Perceptual Color Spaces
Why LAB/LCH Instead of RGB?
- RGB/HSV are device-dependent, not perceptually uniform
- LAB Euclidean distance β perceived color difference
- LCH separates Hue (color wheel position) from Chroma (saturation)
```python
# CIELAB (LAB) Space
L: Lightness (0-100)
a: Green (-128) to Red (+128)
b: Blue (-128) to Yellow (+128)
# CIE LCH (Cylindrical)
L: Lightness (same)
C: Chroma = β(aΒ² + bΒ²) # Colorfulness
H: Hue = atan2(b, a) # Angle 0-360Β°
```
CIEDE2000 is the gold-standard perceptual distance metric:
- Correlates with human perception (r > 0.95)
- Use
colormathorskimage.color.deltaE_ciede2000
β Full details: /references/perceptual-color-spaces.md
---
Earth-Mover Distance (Wasserstein)
Problem: How different are two photo color distributions perceptually?
Sinkhorn Algorithm - Fast O(NM) entropic EMD:
```python
def sinkhorn_emd(palette1, palette2, epsilon=0.1, max_iters=100):
# Kernel K = exp(-CostMatrix / epsilon)
# Iterate: u = a / (K @ v), v = b / (K.T @ u)
# EMD = sqrt(sum(gamma * Cost))
```
Choosing Ξ΅:
| Ξ΅ | Accuracy | Speed |
|---|----------|-------|
| 0.01 | Nearly exact | 50-100 iters |
| 0.1 | Good (recommended) | 10-20 iters |
| 1.0 | Very rough | <5 iters |
Multiscale Sliced Wasserstein (2024):
- O(M log M) vs O(MΒ²Β·β΅) for standard Wasserstein
- Better for spatial distribution differences
β Full details: /references/optimal-transport.md
---
Warm/Cool Classification
LCH Hue Approach:
```
Warm: Red (0-30Β°), Orange (30-60Β°), Yellow (60-90Β°), Magenta (330-360Β°)
Cool: Green (120-180Β°), Cyan (180-210Β°), Blue (210-270Β°)
Transitional: Yellow-Green (90-120Β°), Purple (270-330Β°)
```
LAB b-axis Approach (more robust):
```
b > 20: Warm (yellow-biased)
b < -20: Cool (blue-biased)
-20 β€ b β€ 20: Neutral
```
β Full details: /references/temperature-classification.md
---
Arrangement Patterns
| Pattern | Description |
|---------|-------------|
| Hue-sorted | Rainbow gradient, circular mean handling |
| Warm/cool alternation | Visual rhythm, prevent monotony |
| Temperature wave | Sinusoidal warm β cool β warm |
| Neutral-with-accent | 85% muted + 15% vivid pops |
Palette Compatibility Score:
```python
compatibility = (
emd_similarity * 0.35 +
hue_harmony * 0.25 + # Complementary, analogous, triadic
lightness_balance * 0.15 +
chroma_balance * 0.10 +
temperature_contrast * 0.15
)
```
β Full details: /references/arrangement-patterns.md
---
Diversity Algorithms
Problem: Without constraints, optimization selects all similar colors.
Method 1: Maximal Marginal Relevance (MMR)
```
Score = Ξ» Β· Harmony(photo, target) - (1-Ξ») Β· max(Similarity to selected)
```
- Ξ» = 0.7: Balanced (recommended)
- Ξ» = 1.0: Pure harmony (may select all blues)
- Ξ» = 0.5: Equal harmony/diversity
Method 2: Determinantal Point Processes (DPP)
- Probabilistic: P(S) β det(K_S)
- Automatically repels similar items
- Better for sampling multiple diverse sets
Method 3: Submodular Maximization
- Greedy achieves 63% of optimal
- Theoretical guarantees
β Full details: /references/diversity-algorithms.md
---
Global Color Grading
Problem: Different white balance/exposure across photos = disjointed collage.
Affine Color Transform:
```python
# Find M, b where transformed = M @ LAB_color + b
M, b = compute_affine_color_transform(source_palette, target_palette)
graded = apply_affine_color_transform(image, M, b)
# Blend subtly (30% correction)
result = 0.7 original + 0.3 graded
```
β Full details: /references/arrangement-patterns.md
---
Implementation Summary
Python Dependencies
```bash
pip install colormath opencv-python numpy scipy scikit-image pot hnswlib
```
| Package | Purpose |
|---------|---------|
| colormath | CIEDE2000, LAB/LCH conversions |
| pot | Python Optimal Transport |
| scikit-image | deltaE calculations |
Performance Targets
| Operation | Target |
|-----------|--------|
| Palette extraction (5 colors) | <50ms |
| Sinkhorn EMD (5Γ5, Ξ΅=0.1) | <5ms |
| MMR selection (1000 candidates, k=100) | <500ms |
| Full collage assembly (100 photos) | <10s |
β Full details: /references/implementation-guide.md
---
Your Expertise in Action
When a user asks for help with color-based composition:
- Assess Intent:
- Palette matching for collage?
- Color temperature arrangement?
- Diversity-aware selection?
- Choose Approach:
- Sinkhorn EMD for palette compatibility
- MMR with Ξ»=0.7 for diverse selection
- Appropriate arrangement pattern
- Implement Rigorously:
- Use LAB/LCH spaces (never raw RGB)
- CIEDE2000 for perceptual distances
- Cache palette extractions
- Optimize:
- Adaptive Ξ΅ for Sinkhorn
- Progressive matching (dominant β full)
- Hierarchical clustering by hue
---
Reference Files
| File | Content |
|------|---------|
| /references/perceptual-color-spaces.md | LAB, LCH, CIEDE2000, conversions |
| /references/optimal-transport.md | EMD, Sinkhorn, MS-SWD algorithms |
| /references/temperature-classification.md | Warm/cool, hue sorting, alternation |
| /references/arrangement-patterns.md | Neutral-accent, compatibility, grading |
| /references/diversity-algorithms.md | MMR, DPP, submodular maximization |
| /references/implementation-guide.md | Python deps, Metal shaders, caching |
---
Related Skills
- collage-layout-expert - Color harmonization for collages
- design-system-creator - Color tokens in design systems
- vaporwave-glassomorphic-ui-designer - UI color palettes
- photo-composition-critic - Aesthetic scoring
---
Where perceptual color science meets computational composition.
More from this repository10
Builds production-ready LLM applications with advanced RAG, vector search, and intelligent agent architectures for enterprise AI solutions.
Conducts comprehensive market research, competitive analysis, and evidence-based strategy recommendations across diverse landscapes and industries.
Systematically builds comprehensive visual design databases by analyzing 500-1000 real-world examples across diverse domains, extracting actionable design patterns and trends.
Systematically creates, validates, and improves Agent Skills by encoding domain expertise and preventing incorrect activations.
Manages real-time streaming responses from language models, enabling smooth parsing, buffering, and event-driven handling of incremental AI outputs
Analyzes and refines typography, providing expert guidance on font selection, kerning, readability, and design consistency across digital and print media
Performs semantic image-text matching using CLIP embeddings for zero-shot classification, image search, and similarity tasks.
Validates and enforces output quality by checking agent responses against predefined schemas, structural requirements, and content standards.
Intelligently coordinates multiple specialized skills, dynamically decomposes complex tasks, synthesizes outputs, and creates new skills to fill capability gaps.
Analyze and optimize audio tracks by applying professional mixing techniques, EQ adjustments, and mastering effects for high-quality sound production