{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-color-oklch-8206e692ff54","title":"Convert Color Tokens to Perceptually Uniform oklch Space","summary":"Define color palette tokens in oklch custom properties to ensure consistent lightness and hue perception across design systems and wide-gamut displays.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-color-oklch-8206e692ff54","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-color-oklch-8206e692ff54","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-color-oklch-8206e692ff54.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-color-oklch-8206e692ff54\/download","category":{"slug":"product-design","name":"Product & Design"},"editor_note":"Ensure the color tokens are defined in oklch custom properties and use @media (color-gamut: p3) to serve wide-gamut colors to capable displays.","instructions":"---\nname: color-oklch\ndescription: \"Use when building a design token system, creating accessible colour palettes, generating colour ramps programmatically, or migrating a design system to support wide-gamut displays.\"\nmetadata:\n  category: css\n  priority: low\n  difficulty: intermediate\n  estimatedTime: \"20\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/css\/color-oklch\n---\n\n# Use oklch() and oklab() for perceptually uniform colour palettes\n\nHSL and hex colours are defined in the sRGB colour space, which is not perceptually uniform \u2014 a 10 % lightness change looks dramatically different depending on the hue. This makes creating accessible, harmonious palettes by hand extremely difficult. oklch corrects this: adjusting the L channel produces the same perceived brightness change regardless of hue or chroma, making it far easier to build accessible colour ramps, dark-mode palettes, and consistent hover\/active states.\n\n## Quick Reference\n\n- oklch(L C H) \u2014 Lightness, Chroma, Hue \u2014 is the most practical perceptually uniform colour space for design systems\n- Equal lightness steps in oklch look equal to the human eye; equal steps in hsl do not\n- Define your colour palette tokens in oklch custom properties\n- Use @media (color-gamut: p3) to serve wide-gamut colours to capable displays\n\n## Check\n\nCheck whether the CSS colour tokens use oklch() or a perceptually uniform colour space, or whether they use hsl\/hex which may produce inconsistent perceived lightness across hues.\n\n## Fix\n\nConvert the colour token palette from hsl\/hex to oklch, ensuring the lightness (L) axis is consistent across all hues in the same shade step.\n\n## Explain\n\nExplain what perceptual uniformity means in colour spaces, why oklch is better than hsl for design systems, and how the L, C, H channels map to human colour perception.\n\n## Code Review\n\nReview CSS custom properties for colour tokens. Flag palette definitions in hsl or hex that use hardcoded values without a systematic lightness ramp, especially if they are intended to be interchangeable shade steps.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/css\/color-oklch\n","use_cases":["Creating accessible color palettes for design systems","Generating color ramps with consistent lightness steps","Migrating color systems to support wide-gamut displays"],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/color-oklch\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-23","created_at":"2026-11-22T15:33:19.000000Z","updated_at":"2026-11-23T04:54:56.000000Z","seo_title":"Convert color tokens to oklch for perceptual uniformity","seo_description":"Ensure color tokens use oklch for consistent lightness and hue perception in design systems.","seo_keywords":["convert color tokens to oklch","perceptual uniformity in color spaces","oklch color palette generator","design system color migration","wide-gamut color support"]}}