oklch-skill
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.
What this skill does
# 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](https://oklch.fyi). ## Quick Reference | Category | When to use | Reference | | --- | --- | --- | | Conversion | Hex/rgb/hsl to oklch | [color-conversion.md](color-conversion.md) | | Palettes | Generate scales, multi-hue, dark mode | [palette-generation.md](palette-generation.md) | | Contrast | APCA/WCAG checks, fixing failing contrast | [accessibility-contrast.md](accessibility-contrast.md) | | Gamut & Tailwind | P3 fallbacks, `@theme` scales, gamut clamping | [gamut-and-tailwind.md](gamut-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) ``` | Channel | Range | Description | | --- | --- | --- | | L (Lightness) | 0–1 | 0 = black, 1 = white. Perceptually uniform. | | C (Chroma) | 0–~0.4 | Colorfulness. 0 = gray. Max depends on L and H. | | H (Hue) | 0–360 | Hue angle in degrees. | | alpha | 0–1 | Optional 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 | Rule | Value | | --- | --- | | Light/dark boundary | L > 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 text | 4.5:1 AA, 7:1 AAA | | Contrast fix | Adjust L only — chroma has negligible effect | ## 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. | Before | After | | --- | --- | | `color: #3b82f6` | `color: oklch(0.623 0.188 259.815)` | | Same absolute C across hues | Same 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 | Issue | Fix | | --- | --- | | Hex/rgb/hsl color in new code | Convert to `oklch()` | | HSL palette ramp with hue drift | Rebuild 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 check | Clamp to max chroma for the L/H in sRGB | | Same absolute C across different hues | Use same C% (percentage of max) for consistent vividness | | P3 color without sRGB fallback | Add `@media (color-gamut: p3)` pattern | | Dark mode with hand-picked colors | Derive from light palette by reversing L mapping | | Hex in Tailwind v4 `@theme` | Convert to oklch values | | Alpha with comma syntax | Use slash: `oklch(L C H / alpha)` | ## Reference Files - [color-conversion.md](color-conversion.md) — Supported formats, conversion examples, bulk conversion rules, what to leave alone - [palette-generation.md](palette-generation.md) — Scale convention, generation algorithm, multi-hue palettes, dark mode, why not HSL - [accessibility-contrast.md](accessibility-contrast.md) — APCA and WCAG 2 thresholds, fixing contrast with L, lightness gap guide, hue drift detection - [gamut-and-tailwind.md](gamut-and-tailwind.md) — sRGB vs P3, gamut clamping, CSS fallback patterns, Tailwind v4 @theme and migration
Related in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".