better-colors

Builds, names, and audits color systems for digital product interfaces.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Color problems in product code are usually system problems: values picked in isolation, tokens borrowed because they looked right, and foreground/background pairs nobody measured. This Skill provides a complete methodology for structuring, generating, naming, applying, and verifying color systems so palettes stay consistent, themeable, and accessible. ## Core Features & Use Cases - Palette Structure & Generation: Defines which ramps a system needs (neutral, accent, status), maps Tailwind 50–950 and Radix 1–12 steps to roles, and generates perceptually even ramps from a brand color using libraries like culori or colorjs.io. - Token Naming & Theming: Enforces a two-tier primitive/semantic token model with a strict naming grammar, plus dark mode derivation and a single switching mechanism (prefers-color-scheme, .dark class, or light-dark()). - Contrast & Format Verification: Measures rendered foreground/background pairs against APCA and WCAG 2 thresholds, handles P3 gamut fallbacks, and reports findings in a structured severity-based review format. - Use Case: When auditing a codebase, it inventories every color literal, collapses near-duplicates, assigns roles, and reports findings with severity, location, and measured evidence without changing colors unasked. ## Quick Start Ask the agent to audit the colors in your frontend codebase and report any contrast failures, token misuse, and palette structure issues.

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 (500 in Tailwind, 9 in Radix), then build the ramp outward with even perceived-lightness steps, constant hue, and vividness peaking mid-ramp. Use a color library like culori or colorjs.io rather than computing by hand.

How should I name design tokens for a color system?

Use two tiers: primitives named by hue and step (--blue-500) and semantics named by role (--color-text-secondary). Components only reference the semantic tier, which is what makes dark mode and theming possible without touching component code.

APCA vs WCAG contrast ratio, which should I use?

APCA is the better default for design decisions because it models perceived contrast more accurately, using Lc thresholds like 75 for body text. WCAG 2 ratios remain required when the project must make a formal conformance claim.

Does oklch work in all browsers and do I need a fallback?

oklch is Baseline 2023, so modern browsers support it natively. For older browser matrices, declare the sRGB or hex value first, then override inside an @supports (color: oklch(0 0 0)) block.

Why does my gradient turn gray in the middle?

Gradients between opposite hues pass near the neutral axis in rectangular spaces like sRGB and oklab, producing a gray midpoint. Switch to a polar space with 'in oklch' or add a mid-stop at a hue between the two endpoints.

How do I build a dark mode palette correctly?

Start by swapping semantic roles rather than mechanically reversing values, then reduce vividness, widen separation at the dark end, and remeasure every foreground/background pair. Contrast is not symmetric, so light-mode passes can fail in dark.