home / skills / aidotnet / moyucode / color-converter

color-converter skill

/skills/tools/color-converter

This skill converts colors between HEX, RGB, HSL, HSV, CMYK and can generate color palettes for design workflows.

npx playbooks add skill aidotnet/moyucode --skill color-converter

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
895 B
---
name: color-converter
description: 在HEX、RGB、HSL、HSV和CMYK格式之间转换颜色,支持调色板生成。
metadata:
  short-description: 转换颜色格式
source:
  repository: https://github.com/vaab/colour
  license: BSD-3-Clause
---

# Color Converter Tool

## Description
Convert colors between different formats (HEX, RGB, HSL, HSV, CMYK) and generate color palettes.

## Trigger
- `/color` command
- User needs color conversion
- User wants to generate palettes

## Usage

```bash
# Convert HEX to RGB
python scripts/color_converter.py "#FF5733"

# Convert RGB to HEX
python scripts/color_converter.py "rgb(255,87,51)"

# Generate palette
python scripts/color_converter.py "#FF5733" --palette complementary

# List named colors
python scripts/color_converter.py --list
```

## Tags
`color`, `hex`, `rgb`, `hsl`, `palette`

## Compatibility
- Codex: ✅
- Claude Code: ✅

Overview

This skill converts colors between HEX, RGB, HSL, HSV and CMYK formats, and can generate cohesive color palettes based on a seed color. It is implemented in TypeScript and designed for quick CLI or integrated use to normalize and explore color data. It helps designers and developers switch formats and produce palettes for UI, branding, and data visualization.

How this skill works

Provide a color in any supported format (HEX, rgb(...), hsl(...), hsv(...), or cmyk(...)) and the tool parses it, validates it, and outputs equivalent values in the other formats. It also supports palette generation modes (complementary, analogous, triadic, monochrome, etc.) that compute related colors and return them in the requested formats. Additional commands list named colors or output machine-friendly formats for automated pipelines.

When to use it

  • Converting a color between HEX, RGB, HSL, HSV and CMYK for code or design specs
  • Generating complementary or analogous palettes for UI components or branding
  • Validating and normalizing color inputs in build scripts or design systems
  • Exporting color values in different formats for print or web contexts
  • Listing named colors for quick pick and reference

Best practices

  • Always provide a clearly formatted input (e.g., #RRGGBB or rgb(r,g,b)) to avoid parsing ambiguity
  • Choose HSL for human-friendly hue/saturation/lightness edits and CMYK for print corrections
  • Use palette modes (complementary, analogous, triadic) to maintain visual harmony
  • Verify contrast ratios after conversion when accessibility is required
  • Output canonical HEX for codebases and keep HSL on design side for tweaks

Example use cases

  • Convert #FF5733 to RGB, HSL, HSV and CMYK to include in a style guide
  • Generate a complementary palette for a brand color to build button and background variants
  • Normalize a CSV of mixed color formats into a consistent HEX column for a theme builder
  • Produce print-ready CMYK values from web HEX colors before sending assets to a printer
  • List named colors to quickly select a base color during prototyping

FAQ

What input formats are accepted?

HEX (#RRGGBB), rgb(r,g,b), hsl(h,s%,l%), hsv(h,s%,v%), and cmyk(c,m,y,k) are supported.

Can I generate multiple palette types?

Yes. The tool supports common palette modes such as complementary, analogous, triadic, monochrome, and can output the results in any supported format.