Skip to content
Back to skills

Colors

ASecurity

Color reference for web interfaces: contrast measurement (APCA and WCAG), OKLCH palettes, semantic token assignment, light and dark theming, gamut fallbacks. Use when measuring contrast, building or converting a palette, assigning colors to tokens or theming. Not for which requirement applies ([[accessibility]]) or whole-screen audits ([[interface-review]]).

  • 4 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added September 2, 2026
ai-agentsgo

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 21, 2026

npx -y skills add PrabhdeepSingh/claude-plugins --skill colors --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Colors?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Colors
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/prabhdeepsingh-colors/badge)](https://www.skillsdirectory.com/skills/prabhdeepsingh-colors)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: colors
description: >-
  Color reference for web interfaces: contrast measurement (APCA and WCAG), OKLCH palettes, semantic token assignment, light and dark theming, gamut fallbacks. Use when measuring contrast, building or converting a palette, assigning colors to tokens or theming. Not for which requirement applies ([[accessibility]]) or whole-screen audits ([[interface-review]]).
---

# Color that carries meaning

The project's own instructions win: where its AGENTS.md, CLAUDE.md, design system or established conventions say otherwise, follow them and skip that part of this. Use the project's existing kit and tokens; do not add components, on-screen text or options that the project's design does not call for.

**Respect the existing system.** Reuse the project's semantic tokens and its notation. Do not convert notation because this skill was loaded: a consistent hex or RGB token system is better than a second color representation introduced for one fix. Use OKLCH when the project already uses it, when the task is a new color system or a migration, or when asked to convert.

**Measure, and report before changing.** Contrast claims rest on a measurement, not an estimate. When a pair fails, report the pair, the measured value and the threshold it misses, and leave the colors alone unless asked to fix them. A project's colors are a design decision.

→ `references/accessibility-contrast.md` — the runnable WCAG check, APCA and WCAG thresholds, how to report a failing pair, and how to fix one on request. Read when a change touches a foreground and background pair.

## OKLCH

`oklch(L C H)` or `oklch(L C H / alpha)`. L runs 0–1 and is perceptually uniform, C runs from 0 to about 0.4 with a maximum that depends on L and H, and H is 0–360. Write three decimal places for L and C and up to three for H, drop trailing zeros, and use the slash for alpha. Equal L steps look equally bright and hue stays constant across lightness, which HSL does not give. Not every OKLCH value is displayable in sRGB, so high chroma needs a gamut check.

When converting, change the color values and nothing else. Leave CSS keywords (`currentColor`, `inherit`, `transparent`), gradient interpolation methods and colors in third-party configs that expect hex. Converting a whole file is a migration and needs to be in scope.

→ `references/palette-generation.md` — the scale algorithm, multi-hue ramps and dark-mode palettes. Read when a change creates or extends a palette.

→ `references/gamut-and-tailwind.md` — maximum chroma by hue, P3 fallbacks and Tailwind `@theme` scales. Read when a change uses a wide-gamut or high-chroma color, or edits a Tailwind theme.

→ `references/color-usage.md` — one meaning per color, role tokens, primary-action emphasis, increased-contrast variants. Read when a change assigns a color to a role.

## Thresholds

| Rule | Value |
| --- | --- |
| Light/dark boundary | L > 0.73 = light background → dark text; below it, light text still scores higher |
| Lightness gap (light bg) | Foreground L < 0.35 when background L > 0.9 |
| Lightness gap (dark bg) | Foreground L > 0.9 when background L < 0.25 |
| Hue drift threshold | > 10° spread across palette steps = visible drift |
| APCA body text | \|Lc\| >= 75 minimum, >= 90 preferred |
| APCA non-body text | \|Lc\| >= 60 minimum |
| WCAG 2 normal text | 4.5:1 AA, 7:1 AAA |
| Contrast fix (only when asked) | Adjust L first; preserve C and H when possible, then remeasure the rendered pair |

## Common mistakes

| Issue | Fix |
| --- | --- |
| Raw color bypasses the project's semantic tokens | Reuse or add the role token, in the project's notation |
| Same absolute C across different hues | Use the same C% (percentage of max) for consistent vividness |
| High chroma without a gamut check | Clamp to the max chroma for that L and H in sRGB |
| P3 color without an sRGB fallback | Add the `@media (color-gamut: p3)` pattern |
| Dark mode made by reversing the light palette | Start from the light palette, tune chroma and lightness, recheck every pair |
| Semantic token used outside its role | Add a token for the missing role; do not borrow by value |
| Palette verified only in light mode | Recheck every foreground and background pair in both appearances |

## Reference files

| File | What it answers |
|---|---|
| `references/accessibility-contrast.md` | APCA and WCAG checks, reporting failures, fixing on request |
| `references/palette-generation.md` | Generating scales, multi-hue ramps, dark-mode palettes |
| `references/gamut-and-tailwind.md` | Max chroma, P3 fallbacks, `@theme` scales, gamut clamping |
| `references/color-usage.md` | Semantic tokens, one meaning per color, primary-action emphasis, appearance variants |

## Provenance and maintenance

Last verified 2026-07. The volatile claims here are the platform and tooling ones: OKLCH's Baseline status and browser support, the `@media (color-gamut: p3)` fallback pattern, Tailwind's `@theme` syntax and version-specific behavior (in `references/gamut-and-tailwind.md`), and the APCA thresholds, which track a specification still under revision. Re-verify against current browser-support tables, the project's Tailwind version, and the current APCA and WCAG specifications before treating a specific number or support claim as still true; the perceptual-color-space reasoning and the one-meaning-per-color discipline are stable.

Files in this skill

  • SKILL.md8.6 KB
  • references/accessibility-contrast.md5.2 KB
  • references/color-conversion.md1.8 KB
  • references/color-usage.md4.8 KB
  • references/gamut-and-tailwind.md2.4 KB
  • references/palette-generation.md3.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.