AGENT SKILL

color-expert

Color science workflow for design work: OKLCH/OKLAB color spaces, contrast math (WCAG + APCA), palette construction and semantic naming, and the recurring mistakes that make AI-generated palettes look wrong. Use when a design needs a real palette decision, not just "pick a nice blue."

License 许可
Apache-2.0
最近更新
2026-07-09
Stars
★ 0
Forks
0

01 前言 Front Matter

od
{ "mode": "design-system", "craft": { "requires": [ "color", "accessibility-baseline" ] }, "preview": { "type": "html", "entry": "example.html" }, "category": "design-systems", "upstream": "https://github.com/meodai/skill.color-expert", "example_prompt": "Build a 6-role color palette (background, surface, text, muted, border,\naccent) for a fintech dashboard in OKLCH, and verify every text/background\npair clears WCAG AA contrast." }
name
color-expert
triggers
[ "color theory", "palette generator", "color science", "oklch palette", "contrast check", "build a color palette", "pick an accent color" ]
description
Color science workflow for design work: OKLCH/OKLAB color spaces, contrast math (WCAG + APCA), palette construction and semantic naming, and the recurring mistakes that make AI-generated palettes look wrong. Use when a design needs a real palette decision, not just "pick a nice blue."

02 资源文件 5

03 SKILL.md 正文

color-expert

Color decisions made by eye — "make the accent a nice blue" — are the most common source of palettes that look subtly wrong: muddy darks, an accent that reads differently on different backgrounds, or a contrast failure nobody checked. This skill gives the agent a real workflow: pick a color space that behaves predictably, build the palette from roles instead of hues, and gate every pairing against a contrast minimum before calling it done.

Source and license note

This entry is inspired by meodai/skill.color-expert (licensed CC BY 4.0), which advertises roughly 286K words of upstream reference material. Per this repo's catalogue-vendoring policy (specs/current/catalogue-content-consolidation.md), that volume of upstream text is not bulk-copied into this skill regardless of license terms — the references/ files below are original, distilled explanations of the same underlying color-science ideas (OKLCH, contrast math, palette construction, naming), written for Open Design's token system and cross-referenced against craft/color.md rather than reproduced from the upstream body.

Workflow

  1. Read references/oklch-workflow.md before touching any hex values. Decide the palette in OKLCH (lightness, chroma, hue), not RGB/HSL — it is the color space that keeps perceived lightness and saturation predictable across hues, which is why a "same brightness" pair actually looks the same brightness.
  2. Build roles, not swatches. Follow references/palette-construction.md: neutrals first, one accent, semantic colors last, named by purpose (--accent, --danger) never by hue (--blue-500). This is the same rule craft/color.md enforces at the token layer — this skill is where the palette gets constructed before that file's usage rules apply.
  3. Gate every text/background pair through references/contrast-math.md — WCAG 2.x ratio math and where APCA (used by the Vercel/W3C Silver draft) diverges from it, plus the exact minimums (craft/color.md's 4.5:1 body / 3:1 large-text-and-UI table). Do not ship a pairing that fails the gate; darken the accent to a 600-level OKLCH lightness for text use instead of picking a different hue.
  4. Name and hand off tokens using the semantic naming convention in references/palette-construction.md so the result drops straight into a DESIGN.md or a project's :root block.
  5. Self-check against references/color-mistakes.md before finishing — it is the same list as the checklist below, with the reasoning for each item.

Self-check checklist

  • [ ] Palette was built in OKLCH (or converted to OKLCH for the lightness/ chroma decisions), not eyeballed in RGB/hex.
  • [ ] Every token is named by role (--accent, --success) not by hue (--purple-500).
  • [ ] Every body-text pairing measures ≥ 4.5:1; every large-text/UI-component pairing measures ≥ 3:1 (craft/color.md).
  • [ ] Accent appears in at most the budget craft/color.md sets (2 visible uses per screen) — this skill decides the color, craft/color.md decides the usage discipline; both must hold.
  • [ ] No pure black/pure white background+foreground pair on a dark theme.
  • [ ] The result was checked against references/color-mistakes.md's list of recurring failures (muddy dark mode, accent that shifts across backgrounds, indigo/purple-blue-gradient AI-slop defaults).

Craft integration

This skill composes with craft/color.md (usage discipline: accent budget, contrast minimums, dark-theme handling) and craft/accessibility-baseline.md (the legal-floor contrast requirements this skill's contrast math must clear). Read both before finalizing a palette — this skill decides what the colors are; craft/color.md decides how they get used once decided.

Example

example.html renders a small worked example: an OKLCH-built 6-role palette with swatches, hex/OKLCH values, and a live contrast-ratio table for every text/background pairing, pass/fail against the 4.5:1 / 3:1 minimums.

04 同仓库更多 Skills