Skill library

Agent skill UI design

OKLCH Skill

Work with color, contrast or theme choices for a web interface.

  • Color
  • Accessibility
  • Design systems

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add jakubkrehel/oklch-skill --skill oklch-skill --agent claude-code --yes

Check this file in your project.claude/skills/oklch-skill/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add jakubkrehel/oklch-skill --skill oklch-skill

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. Bring the actual foreground and background in each theme and a color tool that can convert to OKLCH, check gamut and calculate contrast. The fixture used Culori 4.0.2.

View operation manual

What this skill helps with

  • Work with color, contrast or theme choices for a web interface.

Good for

  • Palettes and themes
Skill name
oklch-skill
Scenario
Tune foreground tokens against two notification surfaces
Deliverable
A before-and-after token table with observed pair ratios and fallback decisions.
Skill name
oklch-skill

Define a styling task with a visible result

A request with an unclear outcome

Increase OKLCH lightness difference and mark contrast as passed.

A lightness heuristic can miss gamut mapping, opacity and the real background.

A workflow with observable results

  1. Find the rendered pairs and convert them
  2. Adjust candidates and check gamut
  3. Verify both themes and publish the token table

OKLCH Skill operation manual

Convert the existing colors, adjust lightness and verify rendered contrast and gamut before adopting values.

Replace the bracketed details with your own project and target.

  1. Find the rendered pairs and convert them

    Record normal and dark values with opacity and surface context.

    Prompt · Step 1
    Use oklch-skill to audit [notification text and surface] in [light and dark themes]. Read the resolved foreground and background at the real element, including transparency or overlays. Convert the existing values to OKLCH and record the original token, rendered pair, contrast method and gamut. Start with a before/after table whose proposed column is still empty.
  2. Adjust candidates and check gamut

    Test lightness changes against each actual surface.

    Prompt · Step 2
    Use oklch-skill to propose new values for [failing color pairs]. Start with an L adjustment preserving intended hue, then check the resulting sRGB gamut and reduce chroma if needed. Compute the actual WCAG 2 contrast ratio for each pair, taking alpha into account. If the design calls for a wider-gamut accent, propose the sRGB fallback before the conditional P3 override.
  3. Verify both themes and publish the token table

    Record each change and the resulting observed pair ratio.

    • The table shows all changed colors and actual rendered pair ratios.
    • The chosen fallback is in sRGB and the rendered profile is recorded.
    Prompt · Step 3
    Use oklch-skill to verify [approved notification colors] in the local preview. Check computed pairs in both themes, record measured ratios and indicate which fallback rendered. Return a before-and-after row for every changed color. Mark a P3 hardware check pending if it wasn't exercised. Keep measured contrast scoped to the inspected pairs.

Find the relevant rule

Point the assistant to the installed Skill and a specific issue.

A color is out of gamut after conversionReference
Command or reference
gamut-and-tailwind.md
Examples
Check both gamut and measured contrast after lowering chroma.
Two color metrics disagreeReference
Command or reference
accessibility-contrast.md
Examples
Report the exact method with its threshold and verify WCAG ratios separately.

OKLCH Skill troubleshooting

Can OKLCH L values alone prove contrast?

Use L as a tuning knob and measure the rendered foreground/background pair. In a local sRGB fixture, #777 on white measured 4.478:1 and lowering neutral L to 0.45 measured 7.440:1.