OKLCH color space for web projects. An agent skill from Dinil-Thilakarathne/sona-ui.

MITAuto-check passedFrontend & Design

Install Oklch Skill

skills CLI
$ npx skills add Dinil-Thilakarathne/sona-ui --skill oklch-skill -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install Dinil-Thilakarathne/sona-ui oklch-skill --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/Dinil-Thilakarathne/sona-ui.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/oklch-skill .claude/skills/oklch-skill && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
oklch-skill
GitHub stars
118
Used in
1 other repo
Token cost
~1.2k tokens
SKILL.md length
559 words
Files
5
Skills in repo
10
Repo updated
First seen
Licence
MIT

At a glance

OKLCH color space for web projects. An agent skill from Dinil-Thilakarathne/sona-ui.

  • Color conversion
  • SKILL.md covers Quick Reference, Why OKLCH, OKLCH Syntax and Key Thresholds, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Palette generation

What it does

Oklch Skill is an agent skill from Dinil-Thilakarathne/sona-ui. OKLCH color space for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, and theme with Tailwind v4. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, hue drift, chroma, dark mode colors.

Its SKILL.md is about 1.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files (for example `accessibility-contrast.md`, `color-conversion.md` and `gamut-and-tailwind.md`).

It sits in Frontend & Design, covering Accessibility, Theming and dark mode and Design tokens. It works with Tailwind CSS. The repository describes itself as: A modern UI component library built with React and TailwindCSS to help you build beautiful and accessible web applications faster. The licence is MIT.

When your agent uses it

  • Color conversion
  • Palette generation
  • Dark mode colors

Example prompts

  • “/oklch-skill”

What it can do on your machine

Read from SKILL.md and the folder at commit 9a72ffe. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are css).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • oklch.fyi

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Oklch Skill loads about 1.2k tokens when it runs. Until then it costs about 77 tokens; SKILL.md has 559 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~77
When it runs · the whole SKILL.md, loaded when a task matches
~1.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from Dinil-Thilakarathne/sona-ui at commit 9a72ffe, republished under its MIT licence (© Dinil-Thilakarathne). 559 words, ~1,197 tokens.

Download SKILL.mdSave it as .claude/skills/oklch-skill/SKILL.md (or your agent's skills folder). This skill also uses 4 other files; get the full folder from GitHub.
name
oklch-skill
description
OKLCH color space for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, and theme with Tailwind v4. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, hue drift, chroma, dark mode colors.

OKLCH Colors

OKLCH is a perceptually uniform color space where the numbers actually mean what you think they mean. Most color problems in CSS — broken palettes, failing contrast, hue drift — come from using color spaces that don't match how we see. OKLCH fixes the model so the tools work. To explore interactively, visit oklch.fyi.

Quick Reference

CategoryWhen to useReference
ConversionHex/rgb/hsl to oklchcolor-conversion.md
PalettesGenerate scales, multi-hue, dark modepalette-generation.md
ContrastAPCA/WCAG checks, fixing failing contrastaccessibility-contrast.md
Gamut & TailwindP3 fallbacks, @theme scales, gamut clampinggamut-and-tailwind.md

Why OKLCH

  • Perceptual uniformity. Equal L steps = equal brightness. oklch(0.5 ...) is visually mid. HSL's lightness: 50% varies wildly by hue.
  • Stable hue. HSL blue shifts toward purple as lightness changes. OKLCH hue stays constant across the full lightness range.
  • Independent chroma. Chroma is an absolute measure of colorfulness that doesn't depend on lightness. HSL saturation does.
  • Finite gamut. Not every oklch value maps to a displayable sRGB color. High-chroma values at certain hues will clip — gamut awareness is required.

OKLCH Syntax

oklch(L C H)
oklch(L C H / alpha)
ChannelRangeDescription
L (Lightness)0–10 = black, 1 = white. Perceptually uniform.
C (Chroma)0–~0.4Colorfulness. 0 = gray. Max depends on L and H.
H (Hue)0–360Hue angle in degrees.
alpha0–1Optional transparency. Slash syntax.
css
oklch(0.637 0.237 25.331)
oklch(0.8 0.05 200 / 0.5)

Formatting: L and C use 3 decimal places, H uses up to 3. Drop trailing zeros. Format -0 as 0. Browser support: Baseline 2023, 96%+ global coverage.

Key Thresholds

RuleValue
Light/dark boundaryL > 0.6 = light background → use dark text
Lightness gap (light bg)Foreground L < 0.45 when background L > 0.85
Lightness gap (dark bg)Foreground L > 0.75 when background L < 0.25
Hue drift threshold> 10° spread across palette steps = visible drift
APCA normal text|Lc| >= 60 to pass, >= 75 for pass+
WCAG 2 normal text4.5:1 AA, 7:1 AAA
Contrast fixAdjust L only — chroma has negligible effect
Show full SKILL.md (253 more words)Show less

Review Output Format

Always present color changes as a markdown table with Before and After columns. Include every color that was changed — not just a subset. Never list findings as separate "Before:" / "After:" lines outside of a table.

BeforeAfter
color: #3b82f6color: oklch(0.623 0.188 259.815)
Same absolute C across huesSame C% of each hue's max chroma
No sRGB fallback for P3 color@media (color-gamut: p3) wrapper

This keeps feedback scannable and diff-friendly. Each row is a self-contained change the developer can act on independently.

Common Mistakes

IssueFix
Hex/rgb/hsl color in new codeConvert to oklch()
HSL palette ramp with hue driftRebuild with constant oklch hue
Failing contrast (check foreground vs its background using APCA)Adjust oklch L channel, keep C and H
High chroma without gamut checkClamp to max chroma for the L/H in sRGB
Same absolute C across different huesUse same C% (percentage of max) for consistent vividness
P3 color without sRGB fallbackAdd @media (color-gamut: p3) pattern
Dark mode with hand-picked colorsDerive from light palette by reversing L mapping
Hex in Tailwind v4 @themeConvert to oklch values
Alpha with comma syntaxUse slash: oklch(L C H / alpha)

Reference Files

  • color-conversion.md — Supported formats, conversion examples, bulk conversion rules, what to leave alone
  • palette-generation.md — Scale convention, generation algorithm, multi-hue palettes, dark mode, why not HSL
  • accessibility-contrast.md — APCA and WCAG 2 thresholds, fixing contrast with L, lightness gap guide, hue drift detection
  • gamut-and-tailwind.md — sRGB vs P3, gamut clamping, CSS fallback patterns, Tailwind v4 @theme and migration

© Dinil-Thilakarathne, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 4 other files in .agents/skills/oklch-skill of Dinil-Thilakarathne/sona-ui.

  • SKILL.md
  • accessibility-contrast.md
  • color-conversion.md
  • gamut-and-tailwind.md
  • palette-generation.md

Open the folder on GitHubat commit 9a72ffe

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in Dinil-Thilakarathne/sona-ui, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Oklch Skill next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Oklch Skill compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Oklch Skill this skillDinil-Thilakarathne/sona-ui1181 repos~1.2kAutomated safety check: PassMIT
Better Colorstrycompai/crm11k—~1.9kAutomated safety check: PassMIT
UI Design Systemtry-works/role-model117—~5kAutomated safety check: PassMIT
Design Token Generatordylanfeltus/skills179—~2.9kAutomated safety check: PassMIT
MCP Developmentcoollabsio/coolify63k1 repos~949Automated safety check: PassMIT
Scalar Design Systemscalar/scalar16k—~2.7kAutomated safety check: PassMIT

Similar skills

  • Better Colors

    trycompai/crm

    OKLCH color space and color usage for web projects. An agent skill from trycompai/crm.

    11k GitHub stars~1.9k tokensUpdated 1 mo ago
    Frontend & DesignAuto-check passed
  • UI Design System

    try-works/role-model

    React UI component systems with TailwindCSS + Radix + shadcn/ui.

    117 GitHub stars~5k tokensUpdated today
    Frontend & DesignAuto-check passed
  • Design Token Generator

    dylanfeltus/skills

    Generates type scales, color palettes, spacing systems, WCAG contrast checks and dark mode palettes from formulas, as CSS custom properties, a Tailwind config or JSON tokens.

    179 GitHub stars~2.9k tokensUpdated 23 days ago
    Frontend & DesignAuto-check passed
  • MCP Development

    coollabsio/coolify

    A skill your agent uses for Laravel MCP development. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 1 repo~949 tokens
    Frontend & DesignAuto-check passed
  • Scalar's design system — design tokens, theming (@scalar/themes), CSS variables, and the @scalar/components library.

    16k GitHub stars~2.7k tokensUpdated yesterday
    Frontend & DesignAuto-check passed
  • Extract Design

    Manavarya09/design-extract

    Extract the full design language from any website URL. An agent skill from Manavarya09/design-extract.

    4.2k GitHub stars~786 tokensUpdated 2 days ago
    Frontend & DesignAuto-check: notes

More from Dinil-Thilakarathne/sona-ui

All 10 skills in this repo
  • Sona UI

    Dinil-Thilakarathne/sona-ui

    Discover and integrate Sona UI registry components. An agent skill from Dinil-Thilakarathne/sona-ui.

    118 GitHub stars~1.1k tokensUpdated 4 days ago
    Auto-check passed
  • Smooth Shadow Ring

    Dinil-Thilakarathne/sona-ui

    A skill your agent uses when styling any elevated surface (card, dialog, popover, dropdown, menu, tooltip, sheet, toast) in a Tailwind project that has shadow-plugin installed.

    118 GitHub starsUsed in 1 repo~1k tokens
    Auto-check passed
  • Add Sona Component

    Dinil-Thilakarathne/sona-ui

    Integrate a new component into the Sona UI library end to end — the full per-component pipeline of writing the component, demo, docs, registry entry, nav link, playground controls, regenerating the…

    118 GitHub stars~2.2k tokensUpdated 4 days ago
    Auto-check passed
  • Component Anatomy

    Dinil-Thilakarathne/sona-ui

    Create a source-backed Inspection Board around an existing Sona UI component for social demonstrations and later documentation experiments.

    118 GitHub stars~1.9k tokensUpdated 4 days ago
    Auto-check passed
  • Design Motion Principles

    Dinil-Thilakarathne/sona-ui

    Motion and interaction design expert based on Emil Kowalski, Jakub Krehel, and Jhey Tompkins' techniques.

    118 GitHub starsUsed in 1 repo~1.7k tokens
    Auto-check passed
  • Promote Portfolio Component

    Dinil-Thilakarathne/sona-ui

    Promote a finished Craft, experimental UI, or reusable React component from the user's portfolio into the Sona UI library through an approval-gated two-phase workflow.

    118 GitHub stars~2.2k tokensUpdated 4 days ago
    Auto-check passed

Works with

Questions about Oklch Skill

What does Oklch Skill do?

OKLCH color space for web projects. An agent skill from Dinil-Thilakarathne/sona-ui. Oklch Skill is an agent skill from Dinil-Thilakarathne/sona-ui. OKLCH color space for web projects.

When should I use Oklch Skill?

Oklch Skill fits situations like: color conversion; palette generation; dark mode colors.

How do I install Oklch Skill in Claude Code?

Run `npx skills add Dinil-Thilakarathne/sona-ui --skill oklch-skill -a claude-code`. Or copy the skill folder (.agents/skills/oklch-skill in Dinil-Thilakarathne/sona-ui) into .claude/skills/oklch-skill in your project. Claude Code loads it when a task matches its description.

How do I install Oklch Skill in Codex?

Run `npx skills add Dinil-Thilakarathne/sona-ui --skill oklch-skill -a codex`. Or copy the skill folder (.agents/skills/oklch-skill in Dinil-Thilakarathne/sona-ui) into .agents/skills/oklch-skill in your project. Codex loads it when a task matches its description.

Can I use Oklch Skill in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add Dinil-Thilakarathne/sona-ui --skill oklch-skill -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/oklch-skill, .gemini/skills/oklch-skill, .github/skills/oklch-skill and .opencode/skills/oklch-skill in your project.

What does Oklch Skill need to run?

SKILL.md names no scripts, command-line tools or credentials: Oklch Skill is instructions for the agent only.

Does Oklch Skill access the network?

SKILL.md names 1 domain. As links in the text: oklch.fyi. This is read from the text; nothing was executed.

Is Oklch Skill safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Oklch Skill use?

Oklch Skill is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Oklch Skill use?

About 1.2k tokens (SKILL.md is roughly 4.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Oklch Skill?

Skills that share tags, products or a category with Oklch Skill: Better Colors (trycompai/crm, 11k stars), UI Design System (try-works/role-model, 117 stars), Design Token Generator (dylanfeltus/skills, 179 stars) and MCP Development (coollabsio/coolify, 63k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Oklch Skill?

Dinil-Thilakarathne (a GitHub user) maintains it in Dinil-Thilakarathne/sona-ui, which has 118 GitHub stars. The repository holds 10 skills in this directory. The repository was last updated on October 7, 2026.

Source: Dinil-Thilakarathne/sona-ui on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.