跳到主内容
智客 ZICQ

技能库 智客分类:设计创意 oklch-skill

Oklch Skill

网络项目的 OKLCH 色彩空间 。 将 hex/rgb/hsl 转换为 oklch , 生成调色板, 检查对比度, 处理 Gamut 边界, 并与 Tailwind v4 的主题 。 在oklch上的触发器,颜色转换,调色板生成,对比比,gamut,显示p3,设计符号,hue漂移,铬,暗模式颜色.

3763 安装量

官方网址:skills.sh

技能介绍

先看中文介绍;官方 description 原文单独保留,不改写 SKILL.md。

做什么

网络项目的 OKLCH 色彩空间 。 将 hex/rgb/hsl 转换为 oklch , 生成调色板, 检查对比度, 处理 Gamut 边界, 并与 Tailwind v4 的主题 。 在oklch上的触发器,颜色转换,调色板生成,对比比,gamut,显示p3,设计符号,hue漂移,铬,暗模式颜色.

何时用

参考文献

代理如何加载

按 Agent Skills 渐进披露:启动时只加载 name 与 description(约 100 token);任务匹配后才读入整份 SKILL.md 正文;scripts/、references/、assets/ 仅在需要时再读。 本文件正文结构:OKLCH Colors、Quick Reference、Why OKLCH、OKLCH Syntax、Key Thresholds、Review Output Format。

文件分析

文件分析:这是一份仅含 SKILL.md 的指令型技能,代理激活后整份正文进入上下文。

官方 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 ColorsQuick ReferenceWhy OKLCHOKLCH SyntaxKey ThresholdsReview Output FormatCommon MistakesReference Files

来源分类:skills.sh agent-skill

SKILL.md 与 Agent 调用

官方规范 ↗
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.
  1. 发现技能客户端向 Agent 提供名称与描述目录。
  2. 匹配与调用用户指定或任务匹配后,载入 SKILL.md 指令。
  3. 按需加载按步骤读取参考文档、使用脚本与素材。

具体调用语法与可用工具以目标 Agent 客户端为准。 查看调用机制说明 ↗

安装这个技能

Skills CLI ↗

先选择目标 Agent 和安装范围,保留技能包的附属文件,安装后检查客户端能否发现该技能。

交给 Agent 安装

复制安装指令给支持 Agent Skills 的代理,确认其中的目标目录与客户端匹配。

把 Agent Skill「oklch-skill」安装到我的项目:SKILL.md 原文与官方 description 见 https://zicq.com/zh/skills/skl-4deb98fdfb1d84c2-%E5%A5%A5%E5%85%8B%E5%A5%87%E6%8A%80%E8%83%BD.html
请存为 .cursor/skills/oklch-skill/SKILL.md 或 .claude/skills/oklch-skill/SKILL.md,frontmatter 的 name 与 description 保持原样,不要改写。

GitHub 完整包 ↗

终端安装 · Skills CLI

需要 Node.js 与 npx。先查看仓库技能列表,确认实际名称。

npx skills add 'https://github.com/jakubkrehel/oklch-skill' --list

npx skills add 'https://github.com/jakubkrehel/oklch-skill' --skill 'oklch-skill'

CLI 会交互选择目标 Agent,默认安装到项目;用户级安装使用 -g。先通过查看命令核对仓库内容,再用 npx skills list 检查已安装技能。

阅读排版

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

| Category | When to use | Reference | | --- | --- | --- | | Conversion | Hex/rgb/hsl to oklch | color-conversion.md | | Palettes | Generate scales, multi-hue, dark mode | palette-generation.md | | Contrast | APCA/WCAG checks, fixing failing contrast | accessibility-contrast.md | | Gamut & Tailwind | P3 fallbacks, @theme scales, gamut clamping | 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. |

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 — 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

相关技能

设计创意

Automation Workflows

设计和实施自动化工作流程,以节省时间和规模化操作作为独家. 用于识别重复任务实现自动化,构建跨工具的工作流程,设置触发器和行动,或优化现有自动化. 包括自动化机会识别,工作流程设计,工具选择(Zapier,Make,n8n),测试,和维护. 触发"自动","自动","工作流程自动…

设计创意

Ui Ux Pro Max

UI/UX设计智能及建筑抛光接口实施指导. 当用户要求UI设计,UX流量,信息架构,视觉风格方向,设计系统/托盘,组件规格,副本/显微镜,可访问性,或生成/critique/refine前端UI(HTML/CSS/JS,React,Next.js,Vue,Svelte,Tailw…

设计创意

Frontend Design

创建美丽现代UI的专家前端设计指南. 在构建起落架页面,仪表板,或任何用户界面时使用.

设计创意

N8n Workflow Automation

设计和输出 n8n 工作流程 JSON 有强力触发器, idempotency, 错误处理, 记录, 重试, 以及 人入"一站"审查队列. 当您需要可审计的自动化时使用.