本文へスキップ
Skillpedia
インターフェース(UI/UX)75k · #2776

color-oklch

できること

このスキルは、人が明るさを知覚する仕方に合った、oklchの色空間で色を定義する方法を説明します。デザインシステムやアクセシブルなパレットを作るデザイナーや開発者向けです。

使う場面

  • ✓明るい色と暗い色のブランドカラーのセットを作っているとき。
  • ✓ホバーや押したときの状態が、色によって不均等に見えるとき。
  • ✓同じ知覚的な明るさを保つダークモードのパレットが欲しいとき。

スキルのリンク

https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/color-oklch/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/thedaviddias/Front-End-Checklist/blob/main/skills/color-oklch/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“私のデザインシステム用に、oklchで青のカラーパレットを作り、10段階の色を均等な間隔にしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントは色のトークンをoklchに変換し、各段階で明度の値を色相をまたいで一定に保ち、対応している画面には広い色域の色を提供できます。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Use oklch() and oklab() for perceptually uniform colour palettes

HSL and hex colours are defined in the sRGB colour space, which is not perceptually uniform — 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.

Quick Reference

  • oklch(L C H) — Lightness, Chroma, Hue — is the most practical perceptually uniform colour space for design systems
  • Equal lightness steps in oklch look equal to the human eye; equal steps in hsl do not
  • Define your colour palette tokens in oklch custom properties
  • Use @media (color-gamut: p3) to serve wide-gamut colours to capable displays

Check

Check 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.

Fix

Convert the colour token palette from hsl/hex to oklch, ensuring the lightness (L) axis is consistent across all hues in the same shade step.

Explain

Explain 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.

Code Review

Review 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.


For full implementation details, code examples, and framework-specific guidance, see references/rule.md.

Rule page: https://frontendchecklist.io/rules/css/color-oklch

よくある質問

hslでは、なぜ不十分ですか?

hslは知覚的に均一ではないため、明度を10パーセント変えても、色相によってまったく違って見えることがあると、このスキルは説明しています。

L、C、Hは何を意味しますか?

明度、彩度、色相で、oklchの色の三つの要素です。

一部の画面に、より広い色を提供できますか?

はい。対応しているディスプレイに広い色域の色を提供するため、色域のメディアクエリを使うと、このスキルは述べています。

詳細

作者による元の説明

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.

repo: thedaviddias/Front-End-Checklist

人気

GitHubのスター
75k
ランキング
#2776
ライセンス
MIT
更新日
2026/10/31

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル