color-convert

Convert colors between HEX, RGB, HSL, and OKLCH formats and validate WCAG contrast ratios.

15|3|Updated Jul 9, 2026
One-click install
npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill color-convert-kiurakku
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: color-convert
Source: https://github.com/kiurakku/cursor-kit-for-ai/tree/main/plugins/devtools/skills/color-convert
Command: npx skills add https://github.com/kiurakku/cursor-kit-for-ai --skill color-convert-kiurakku

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires coloraide.

What problem does it solve? Working with colors across design tools, CSS, and code requires constant format conversion, and ensuring text meets accessibility contrast standards is easy to get wrong. This Skill handles color format conversion, palette generation, and WCAG contrast validation in one place. ## Core Features & Use Cases - Format Conversion: Convert between HEX, RGB, RGBA, HSL, HSLA, OKLCH, and named CSS colors, with gamut clipping warnings for OKLCH-to-sRGB conversions. - Palette Generation: Generate monochromatic scales, complementary and analogous colors, and Tailwind-style 50-950 design token scales with CSS custom property output. - WCAG Contrast Checking: Compute contrast ratios between foreground and background colors and validate against AA/AAA levels for normal and large text. - Use Case: You are theming a UI and need to know whether white text on #2563EB passes WCAG AA. The Skill computes the 5.17:1 ratio, confirms it passes, and outputs the color in HEX, RGB, HSL, and OKLCH for your stylesheet. ## Quick Start Convert #3B82F6 to RGB, HSL, and OKLCH, then check whether white text on it passes WCAG AA.

Frequently Asked Questions about color-convert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I convert HEX to RGB and HSL in Python?▼

Parse the hex string into integer RGB channels, then use the colorsys module's rgb_to_hls function to get hue, saturation, and lightness values. The Skill provides ready-to-use hex_to_rgb and rgb_to_hsl functions with validation for 3-digit and 6-digit hex formats.

How do I check WCAG contrast ratio between two colors?▼

Compute relative luminance for each color using the sRGB linearization formula, then divide the lighter luminance plus 0.05 by the darker plus 0.05. WCAG AA requires 4.5:1 for normal text and 3:1 for large text, while AAA requires 7:1 and 4.5:1 respectively.

What is OKLCH and when should I use it in CSS?▼

OKLCH is a perceptually uniform color space where lightness changes feel even to the human eye, making it better than HSL for generating color scales. Use it for modern CSS theming with hex fallbacks, but note that some OKLCH colors clip when converted to sRGB.

Does OKLCH conversion require external Python libraries?▼

Yes, OKLCH conversion requires the coloraide package, installed via pip install coloraide. Basic HEX, RGB, and HSL conversions work with only the Python standard library's colorsys module.

Why does my color fail WCAG AA even though it looks readable?▼

Perceived readability differs from computed luminance contrast, especially for mid-tone grays and pastels on white. For example, #94A3B8 on white yields only 2.56:1, failing AA; darkening to #64748B raises the ratio to 4.68:1 and passes.