better-colors

Convert, generate, and validate OKLCH color palettes for web projects.

Updated Sep 3, 2026
One-click install
npx skills add https://github.com/xzedm/clipplic-landing --skill better-colors-xzedm
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: better-colors
Source: https://github.com/xzedm/clipplic-landing/tree/main/.agents/skills/better-colors
Command: npx skills add https://github.com/xzedm/clipplic-landing --skill better-colors-xzedm

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Web projects often rely on HSL or hex colors that produce inconsistent perceived brightness, hue drift across palette steps, contrast failures, and gamut clipping on modern displays. This Skill provides rules and references for working in the OKLCH perceptual color space so palettes stay uniform, accessible, and display-safe. ## Core Features & Use Cases - Color Conversion: Convert hex, rgb, and hsl values to oklch with consistent formatting and precision rules. - Palette Generation: Build lightness scales, multi-hue palettes, and dark mode variants with constant hue and percentage-based chroma. - Contrast & Gamut Validation: Check APCA and WCAG contrast ratios, clamp out-of-gamut chroma, and add P3 fallbacks with sRGB defaults. - Tailwind v4 Theming: Author @theme color scales in oklch and define semantic tokens with one meaning per color. - Use Case: When migrating a Tailwind v4 theme from hex to oklch, use this Skill to convert each token, verify every foreground/background pair in both light and dark appearances, and clamp any chroma values that exceed the sRGB gamut. ## Quick Start Convert the hex colors in my Tailwind theme to oklch and check the contrast of every text and background pair in both light and dark mode.

Frequently Asked Questions about better-colors

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

FAQPage Schema
How do I convert hex colors to oklch in CSS?▼

Convert hex to oklch by mapping the color into the OKLCH space and writing it as oklch(L C H), with three decimal places for lightness and chroma. Tools like oklch.fyi let you explore conversions interactively before committing values to your stylesheet.

How do I generate a color palette without hue drift?▼

Build the palette in OKLCH by holding the hue angle constant across all lightness steps instead of using HSL lightness ramps. A hue spread greater than 10 degrees across steps indicates visible drift that needs correction.

Does Tailwind v4 support oklch theme colors?▼

Yes, Tailwind v4 supports oklch values directly in @theme blocks, and converting hex tokens to oklch is the recommended approach. Define your scales as oklch values so lightness steps remain perceptually uniform.

Why do my oklch colors look wrong on some displays?▼

High-chroma oklch values can fall outside the sRGB gamut and clip on standard displays. Clamp chroma to the maximum for the given lightness and hue, and wrap Display P3 colors in a @media (color-gamut: p3) query with an sRGB fallback.

What contrast ratio should oklch color pairs meet?▼

For APCA, body text needs an absolute Lc of at least 75 with 90 preferred, and non-body text needs at least 60. For WCAG 2, normal text requires 4.5:1 for AA and 7:1 for AAA; adjust lightness first when fixing failures.

When should I not convert a project to oklch?▼

Do not convert when the project already has a consistent hex or RGB token system and the task is an isolated fix. Introducing a second color notation for one change creates inconsistency; reserve OKLCH migration for dedicated color-system work.