better-colors

Generates, names, and audits CSS color systems including ramps, tokens, and contrast checks.

Updated Jun 28, 2026
One-click install
npx skills add https://github.com/AO-HyS/aohys.com --skill better-colors-ao-hys
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: better-colors
Source: https://github.com/AO-HyS/aohys.com/tree/main/.agents/skills/better-colors
Command: npx skills add https://github.com/AO-HyS/aohys.com --skill better-colors-ao-hys

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Color bugs in interfaces are usually system bugs: values picked in isolation, tokens borrowed because they looked right, and contrast pairs nobody measured. This Skill provides a rigorous methodology for building and auditing color systems so every value has a role, every token has a consistent name, and every contrast claim is measured rather than estimated. ## Core Features & Use Cases - Palette Generation: Build perceptually uniform color ramps from a brand color using libraries like culori, with even lightness steps, constant hue, and correct light-end density. - Token Architecture: Establish a two-tier primitive/semantic token system with a consistent naming grammar (--color-{role}-{variant}-{state}) that makes dark mode and theming possible. - Contrast Measurement: Measure foreground/background pairs against APCA (Lc) or WCAG 2 thresholds and report failures without silently repainting design decisions. - Use Case: When auditing a codebase, inventory every color literal, collapse near-duplicates, assign each survivor a role, and produce a severity-ranked findings table grouped by violated principle. ## Quick Start Ask the AI to audit the color tokens in your stylesheet and report any contrast failures, naming inconsistencies, or ramp problems it finds.

Frequently Asked Questions about better-colors

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

FAQPage Schema
How do I generate a color palette from a brand color?▼

Place the brand color on the solid-fill step (Tailwind 500 or Radix 9), then build the ramp outward using perceptual interpolation with a library like culori. Keep hue constant, space steps evenly in perceived lightness, and let vividness peak mid-ramp.

How do I check color contrast for accessibility?▼

Measure the foreground against the background it actually renders on, not the page background. Use APCA thresholds (Lc 75 for body text, Lc 60 for non-body) as the default, or WCAG 2 ratios (4.5:1 for normal text) when legal conformance is required.

Should I use oklch or hex for CSS colors?▼

Match whatever notation the project already uses, since consistency beats format. For a genuinely new color system, oklch is the best default because its lightness is perceptually uniform and hue stays stable across a ramp.

How do I name CSS color tokens for dark mode?▼

Use two tiers: primitives named by hue and step (--blue-500) and semantic tokens named by role (--color-text-secondary). Components reference only the semantic tier, so dark mode repoints the semantics without touching any component.

Why does my dark mode palette look wrong when reversed?▼

A dark palette is not the light one mechanically reversed. After swapping roles, reduce vividness since colors read as neon on near-black, widen separation at the dark end, and remeasure every contrast pair because APCA is not symmetric.

When should I fix a failing contrast pair myself?▼

Report the failing pair, its measured value, and the missed threshold without changing colors, since they are a design decision. Only adjust when asked, and then change lightness rather than hue, remeasuring afterward.