AgentSkillsCN

dominant-color

从图像中提取主色调。当用户希望找出图像中的主要色彩,或生成色彩搭配方案时,即可调用此技能。

SKILL.md
--- frontmatter
name: dominant-color
description: Extract dominant colors from an image. Use when the user wants to find the main colors in an image or generate a color palette.
argument-hint: <image-path> [options]
allowed-tools: Bash(python *), Read

Dominant Color Extraction

Extract dominant colors from an image file using the extract_colors.py script.

Script Usage

code
python ~/.claude/skills/dominant-color/scripts/extract_colors.py <image> [options]

Options

FlagDescription
-n, --count NNumber of colors to extract (default: 5)
-q, --quality 1-10Extraction quality, 1=best (default: 1)
-f, --format FORMATOutput format: hex, rgb, tuple, full
--jsonOutput as JSON
--dominant-onlyOnly output the dominant color

Examples

bash
# Basic usage
python script.py image.png

# Get 8 colors as hex values
python script.py image.jpg -n 8 -f hex

# JSON output for programmatic use
python script.py image.png --json

# Just the dominant color
python script.py image.png --dominant-only -f hex

Instructions

  1. Run the script with the image path provided by the user: $ARGUMENTS
  2. Present the extracted colors clearly
  3. If the user needs the colors for code, offer to format them as CSS variables, Tailwind config, or other formats