跳到正文
cccskills
免费在 GitHub 公开

image-analysis

Extract color palettes from images (screenshots, Figma exports, design mockups) to help implement matching UI. Use when the user shares a screenshot, design image, or asks to "match these colors", "extract colors from this image", "implement this design", or "get the color palette".

中文简介正在准备中。当前显示原文说明。

集成工具Figma
查看安装方法

包含的文件(5)

  • SKILL.md3.7 KB
  • scripts/extract-colors.js823 B
  • scripts/extract-colors.sh521 B
  • scripts/package-lock.json23.3 KB
  • scripts/package.json164 B

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Image Analysis — Color Extraction

Extract dominant colors from any image file (PNG, JPG, WebP, BMP, GIF) and return a structured palette. Useful for implementing UIs that match a screenshot, Figma export, or design mockup.

When to Use

  • The user provides a screenshot or design image and wants to implement it
  • The user asks to extract or identify colors from an image
  • The user wants a color palette from a photo or mockup
  • The user wants to match their code's colors to a reference image

How It Works

  1. Reads the image file using get-pixels to obtain raw pixel data
  2. Passes pixel data to extract-colors to compute dominant colors
  3. Returns a sorted palette (by area/prominence) with hex, RGB, HSL values, and area coverage

Usage

Run the extraction script, passing the image path as the first argument:

bash <skill-path>/scripts/extract-colors.sh /path/to/image.png

Arguments:

  • $1 — Path to the image file (required). Supports PNG, JPG, WebP, BMP, GIF.

Examples:

# Extract colors from a screenshot
bash <skill-path>/scripts/extract-colors.sh ./screenshot.png

# Extract colors from a Figma export
bash <skill-path>/scripts/extract-colors.sh ~/Downloads/figma-design.jpg

Output

The script outputs a JSON array of colors sorted by prominence:

[
  {
    "hex": "#1a1a2e",
    "red": 26,
    "green": 26,
    "blue": 46,
    "hue": 0.6667,
    "saturation": 0.2778,
    "lightness": 0.1412,
    "area": 0.3241
  },
  {
    "hex": "#e94560",
    "red": 233,
    "green": 69,
    "blue": 96,
    "hue": 0.9724,
    "saturation": 0.7928,
    "lightness": 0.5922,
    "area": 0.1856
  }
]
FieldTypeDescription
hexStringColor as hex string (e.g. #1a1a2e)
redIntegerRed channel (0-255)
greenIntegerGreen channel (0-255)
blueIntegerBlue channel (0-255)
hueNumberHue (0-1)
saturationNumberSaturation (0-1)
lightnessNumberLightness (0-1)
areaNumberRelative area/prominence (0-1)

Present Results to User

After extracting colors, present them as a structured palette:

Color Palette (sorted by prominence):

1. #1a1a2e — 32.4% (dark navy) — Primary background
2. #e94560 — 18.6% (coral red) — Accent color
3. #f5f5f5 — 15.2% (light gray) — Secondary background
...

Then suggest how to use these colors in the user's codebase:

  • CSS custom properties / variables
  • Tailwind config theme colors
  • Design token definitions
  • Direct usage in component styles

Troubleshooting

"Cannot find module" errors

The script auto-installs dependencies (extract-colors, get-pixels) on first run. If this fails, install them manually:

cd <skill-path>/scripts && npm install

Unsupported image format

The underlying get-pixels library supports PNG, JPG, GIF, and BMP. For other formats, convert the image first.

Large images are slow

The extract-colors library automatically downsamples to 64,000 pixels by default. For very large images this is already fast, but you can adjust the pixels option in the script if needed.

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

Multi-model agent orchestration using specialized agents for planning, coding, research, math/science, visual analysis, and adversarial review. Use when tasks are complex enough to benefit from different models' strengths, when you want adversarial review to catch blind spots, or when coordinating multi-step workflows across agent roles. Triggers on complex projects, multi-step tasks, architecture decisions, or when explicitly requested.

中文简介正在准备中。当前显示原文说明。

pascalorg/skills982026年9月11日 更新

Check color contrast ratios against WCAG AA and AAA accessibility standards. Use when the user wants to verify if their color combinations are accessible, check contrast between text and background colors, or audit a palette for accessibility.

中文简介正在准备中。当前显示原文说明。

pascalorg/skills982026年9月11日 更新

Audit a .glb or .gltf and make it small, correct, and fast to load in a browser, with a measured before/after report. Use when a model is "too big" or "slow to load", when the user asks to "optimize this GLB", "compress this glTF", or "export for web", or when they mention Draco, meshopt, gltfpack, KTX2, Basis, texture VRAM, draw calls, or a Blender / CAD / photogrammetry / Pascal export headed for Three.js, React Three Fiber (drei useGLTF), Babylon.js, or model-viewer. Covers inspection, spec validation, geometry and texture compression, scene-graph cleanup, and the correctness checks (metres, Y-up, node names, animations, PBR fidelity, alpha modes, vertex colors) that must not regress. Not for editing or modelling geometry, authoring or laying out a scene, generating 3D from text or images, converting from FBX/OBJ/CAD, or debugging a runtime frame rate that has nothing to do with asset size.

中文简介正在准备中。当前显示原文说明。

pascalorg/skills982026年9月11日 更新

Compare two images pixel-by-pixel and get a visual diff. Use when the user wants to compare their implementation against a design, spot differences between two screenshots, or verify visual regression.

中文简介正在准备中。当前显示原文说明。

pascalorg/skills982026年9月11日 更新

Extract text from images using OCR. Use when the user shares a screenshot and you need to read the text content, copy UI labels, or extract copy from a design mockup.

中文简介正在准备中。当前显示原文说明。

pascalorg/skills982026年9月11日 更新

Web design reference for building production-grade interfaces. Covers layout, typography, color, spacing, shadows, animation, accessibility, responsive design, components, performance, and UX psychology. Use when building UI, reviewing design quality, choosing design tokens, or making any visual design decision.

中文简介正在准备中。当前显示原文说明。

pascalorg/skills982026年9月11日 更新

查看 pascalorg 的全部技能

报告此技能的问题