OKLCH Skill: modern CSS colours, palettes and contrast
jakubkrehel/oklch-skill
A colour guide for your AI assistant. It moves the colours in your site's styles to OKLCH, a newer way of writing colours where the numbers match what the eye sees. It also builds colour scales, fixes text that is hard to read and sets up themes for Tailwind CSS.
Pack description by its author: “A colour guide for your AI assistant. It moves the colours in your site's styles to OKLCH, a newer way of writing colours where the numbers match what the eye sees. It also builds colour scales, fixes text that is hard to read and sets up themes for Tailwind CSS.”
Design and frontendKnowledge and rules for your assistant
1. Changes your files
Skills that write or edit files: oklch-skill.
github.com/jakubkrehel/oklch-skill/blob/0e81f04/2. Runs code on your machine
Install: Five markdown files: SKILL.md and four reference files. No hooks, no scripts. At work: Tells the assistant to edit colour values in your CSS and Tailwind theme files.
github.com/jakubkrehel/oklch-skill/blob/0e81f04/3. Sends data
github.com/jakubkrehel/oklch-skill/blob/0e81f04/Checked against the pack's files at commit 0e81f04, on Nov 21, 2026. Tap a verdict to see its source.How we checkedReport an error
Good for you if
- You want your site's hex, rgb or hsl colours converted to OKLCH
- You need a colour scale from 50 to 950 for a design system or a dark mode
- Some text on your site is hard to read and you want the contrast fixed
- You build with Tailwind CSS v4 and want your own colours in its theme
Probably not for you if
- You want the exact numbers computed by a tool: the guide asks the assistant to check them with a real contrast calculation
What its answer looks like
The skill's own Before / After review table
| `color: #3b82f6` | `color: oklch(0.623 0.188 259.815)` |
The skill's own example, from skills/oklch-skill/SKILL.md. More examples
What you'll notice
- Colour changes shown as a Before / After table, with every changed colour listed
- New colours written as oklch(L C H) instead of hex
- Contrast fixed by changing only the lightness of the text, keeping its hue
- A plain fallback colour for older screens and browsers when a very vivid colour is used
What you need
- Agents that read skills (installed with the skills.sh tool)
- Free, MIT license
- One command with the skills.sh tool
Words on this page
- Skill
- A set of written instructions your AI assistant follows. Installing one is like giving it a playbook.
| Repository | jakubkrehel/oklch-skill · website |
|---|---|
| GitHub stars | 288 |
| Skills | 1 |
| Category | Design and frontend |
| License | MIT |
| Last updated | Oct 7, 2026 · card checked Nov 21, 2026 at commit 0e81f04 |
| Install counts | jakubkrehel/oklch-skill on skills.sh, Vercel's skills directory, which shows installs and security audits per skill |
jakubkrehel/oklch-skill popularity over time
What OKLCH Skill does
- Converts hex, rgb and hsl colours to oklch(), changing only the colour values and leaving the rest of the CSS as it was
- Builds 5, 9 or 11 step palettes (50 to 950) by spreading lightness evenly and keeping each step within what screens can show
- Builds several hues with the same lightness and the same share of maximum vividness, so they look equally bright
- Makes dark mode by reversing the palette: the lightest step becomes the darkest
- Checks contrast with APCA by default and WCAG 2 for formal compliance, and fixes it by moving lightness only
- Spots hue drift in old HSL palettes: more than 10 degrees of spread between steps
- Clamps colours that are too vivid for ordinary screens and adds Display P3 and older-browser fallbacks
- Writes Tailwind CSS v4 @theme colour scales in oklch
Never cut, per the skill: CSS keywords (currentColor, inherit, initial, unset, transparent), gradient interpolation methods and colours in third-party library configs that expect hex.
From the pack's SKILL.md files, summarised by AgentGid.
The skill, explained
oklch-skill
Rewrites, builds and checks the colours in your site's styles
You give
- Your stylesheet, Tailwind theme or a base colour
- Palette size you want: 5, 9 or 11 steps
- The text colour and the background it sits on, for a contrast check
You get
- A Before / After table of every changed colour
- Colours as oklch(L C H) values
- A palette as CSS variables --color-50 to --color-950, or a Tailwind @theme scale
- Fallback CSS for Display P3 screens and for browsers without oklch
Its rules, in pictures
Sample brand scale from the skill's Tailwind @theme example (hue 250, steps 50 to 950)
Each visual acts out what it does
| In your design | The story it plays |
|---|---|
| Same lightness, same 80% of maximum vividness | Blue oklch(0.623 0.141 250), green oklch(0.623 0.157 145) and red oklch(0.623 0.202 25) look equally bright |
| Contrast fix | Text oklch(0.65 0.2 250) on oklch(0.75 0.05 250) fails; darkening only the text to oklch(0.35 0.2 250) fixes it |
Drawn by AgentGid from the values in the skill's files. This is not output of the skill; sample text is ours.
See it in action
The skill defines what its answer looks like. Its own example:
| `color: #3b82f6` | `color: oklch(0.623 0.188 259.815)` |
The skill defines what its answer looks like. Its own example:
border: 1px solid oklch(0 0 0 / 0.1);
When to reach for it
| You want | Use |
|---|---|
| Convert old colours | Ask to convert a file or theme to oklch |
| A colour scale | Ask for a 5, 9 or 11 step palette from one base colour |
| Readable text | Ask to check and fix the contrast of a text colour on its background |
| Vivid colours on new screens | Ask for Display P3 colours with an sRGB fallback |
Skills in jakubkrehel/oklch-skill
| Skill | In plain words | Changes files? | What it does (author) |
|---|---|---|---|
| oklch-skill | Rewrites, builds and checks the colours in your site's styles | Yes | 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.npx skills add jakubkrehel/oklch-skill --skill oklch-skill |
The author's descriptions come from each skill's SKILL.md; the plain-words column is AgentGid's.
Good to know before you install
- It switches on by itself when you mention colour words such as palette, contrast ratio, design tokens or dark mode colors.
- It treats hex, rgb and hsl colours in new code as a mistake and converts them to oklch().
- Only markdown: no scripts ship with it, so the assistant works out the colour numbers itself. The guide says its contrast rules are approximations.
- It uses APCA contrast by default; WCAG 2 is still needed when you must claim formal WCAG conformance.
- The author's interactive OKLCH tool is at oklch.fyi.
Before you start
Works in
- Agents supported by the skills.sh installer: skills folder
You will need
- Node.js (for npx): The documented install runs the skills tool through npx
Mistakes to avoid
Fix failing contrast by making the text colour less or more vivid
Change only the lightness (L) of the text, keep chroma and hue
The skill says chroma has almost no effect on contrastTrust the assistant's contrast numbers as final
Check the final pair with a real contrast calculator or a library such as Color.js
The pack ships no code; its lightness gaps are approximationsUse the same absolute chroma for every hue in a multi-hue palette
Use the same percentage of each hue's maximum chroma
Hues have different maximum chroma at the same lightness, so equal C looks unequally vividConvert hex colours inside third-party library configs too
Leave colours that a library expects as hex alone
The skill lists them under what to leave aloneShip a high-chroma P3 colour with no fallback
Put an sRGB value first and the P3 value inside @media (color-gamut: p3)
Not every P3 colour exists in sRGB, so it clips on ordinary screens
Which one to pick
| If you need | Pick |
|---|---|
| You need colour work in OKLCH: conversion, palettes, contrast, gamut fallbacks, Tailwind v4 themes | This pack |
| You want a full design review of UI code with WCAG accessibility checks, not just colours | rams-design/rams-plugin |
| You want overall art direction and taste for the interface, beyond colour values | Leonxlnx/taste-skill |
Works well with
- colorjs-io: Computes OKLCH conversions, P3 gamut and contrast exactly, which the skill asks to verify with a real calculation
- tailwind-css-colors: Tailwind's default palette is in OKLCH; the skill writes custom @theme scales in the same convention
- axe-core: Automated WCAG checks on the rendered page after colours change
May I use it like this?
| Use | Answer | Condition |
|---|---|---|
| In a commercial app | Yes | MIT |
| Work for clients | Yes | MIT |
| Passing the files on | With conditions | MIT: keep the copyright and permission notice in copies of the skill files |
Install OKLCH Skill
Official commands from the repository
npx skills add jakubkrehel/oklch-skill
The skills tool copies the skills/oklch-skill folder (SKILL.md plus four reference files) into your agent's skills folder.
Remove: delete the oklch-skill folder from your agent's skills folder
Or with the open-source skills CLI: npx skills add jakubkrehel/oklch-skill. Skills are instructions your agent follows: read them before installing.
What it installs and runs on your machine
Read in the code at commit 0e81f04, Nov 21, 2026
| When | What happens |
|---|---|
| Install | Five markdown files: SKILL.md and four reference files. No hooks, no scripts. |
| At work | Tells the assistant to edit colour values in your CSS and Tailwind theme files. |
Quick answers
- Can I use it for paid client sites?
- Yes. The pack is under the MIT license; keep the license notice if you share the files.
- Will it change gradients or keywords like currentColor?
- No. It converts only the colour stops inside gradients and leaves CSS keywords as they are.
- Do old browsers break?
- The guide gives a hex fallback inside an @supports block for browsers without oklch, and notes oklch is Baseline 2023.
- How many steps does a palette have?
- Nine by default, matching Tailwind; five or eleven on request.
- Does it need an account or a key?
- No. It is a set of markdown files with no scripts and no network calls.
Checked by AgentGid on Nov 21, 2026 against commit 0e81f04 of the pack's own files. agent.md for AI agents · Report a mistake
More design and frontend skill packs
| # | Install | |||||
|---|---|---|---|---|---|---|
| 1 |
Gets a local design library: UI styles, colour palettes, font pairings and UX rules for many product types. Before it builds a page, it looks up a matching style, colours and fonts and follows a checklist. Extra skills make logos, banners, slides and brand files; logos, mockups and icons need your own key for an outside image service. |
153K | +13.9K | 7 | ||
| 2 |
Stops building the average landing page. It picks one of 20 researched design directions, finds real, credited pictures in open archives, then checks the page in a real browser and fixes what looks wrong. Dashboards and app screens get their own set of rules. |
120K | +18.7K | 1 | ||
| 3 |
Turns a description, a Mermaid sketch or your project's code into an interactive diagram saved as one HTML file. It can also answer a question as a one-page explainer, with the conclusion first. The pack's own tools check every file before handing it to you. |
98.7K | +12.7K | 5 | ||
| 4 |
Draws clean, editorial diagrams in your brand colours and fonts. You describe the diagram in plain words and get one HTML file you open with a double click. It can also redraw old draw.io, Mermaid or Excalidraw diagrams and export them as SVG or PNG. |
70K | +11.4K | 1 | ||
| 5 |
Builds web pages that look designed, not machine-made. It asks once for your real material and picks one of fifty visual themes. Then it builds the page and checks it against common AI design habits. Name it and it will also redesign or review a page you already have. |
59.2K | +25.2K | 1 | ||
| 6 |
alchaincyf/huashu-design
Checked
One large design playbook for your AI assistant, written in Chinese. It makes clickable app prototypes, web pages, slide decks, infographics and short animated videos as HTML, then exports them to PDF, PowerPoint, MP4 or GIF. Before any new design it shows you three real drafts to choose from and stops until you pick one. |
30.3K | +4,613 | 1 |
No pack matches.