better-colors
Что он делает
Этот скилл направляет ИИ через конвертацию цветов, создание палитр, проверку контраста и применение цвета с понятным смыслом. Он предназначен для дизайнеров и разработчиков, которые оформляют веб-интерфейсы.
Когда использовать
- ✓Когда нужно перевести цвета между hex, RGB, HSL и OKLCH.
- ✓Когда вы хотите создать палитру цветов или цвета для тёмной темы.
- ✓Когда нужно проверить, достаточно ли контрастны текст и фон.
Ссылка на скилл
https://github.com/trycompai/crm/blob/release/.agents/skills/better-colors/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“Постройте, пожалуйста, светлую и тёмную палитры для моего приложения и проверьте, что текст достаточно контрастен для чтения.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
ИИ сохраняет существующую цветовую систему проекта, создаёт палитры в воспринимаемом цветовом пространстве и измеряет контраст до того, как предложить исправления.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
OKLCH Colors
OKLCH is a perceptually uniform color space where lightness, chroma, and hue are useful design controls. Use it when the project already uses OKLCH, when creating a new color system, or when the user asks for conversion or palette work. Otherwise preserve the project's established tokens and notation: a consistent hex or RGB token system is better than introducing a second color representation for an isolated fix. 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, reporting failures, fixing on request | accessibility-contrast.md |
| Gamut & Tailwind | P3 fallbacks, @theme scales, gamut clamping |
gamut-and-tailwind.md |
| Usage | Semantic tokens, one meaning per color, primary-action emphasis, appearance variants | color-usage.md |
Core Principles
1. Use a Perceptual Color Space
- Respect the existing system. Do not convert notation merely because this skill was loaded. Reuse the project's semantic tokens and authoring format unless the task includes a color-system migration.
- Perceptual uniformity. Equal L steps = equal brightness.
oklch(0.5 ...)is visually mid. HSL'slightness: 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.
2. Write and Format OKLCH Consistently
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)
Use three decimal places for L and C and up to three for H. Drop trailing zeros and format -0 as 0. OKLCH is Baseline 2023; when support requirements are unusually broad, check the target project's browser matrix instead of relying on a fixed global-coverage percentage.
3. Measure Contrast, Gamut, and Palette Behavior
| Rule | Value |
|---|---|
| Light/dark boundary | L > 0.73 = light background → dark text; below it, light text still scores higher |
| Lightness gap (light bg) | Foreground L < 0.35 when background L > 0.9 |
| Lightness gap (dark bg) | Foreground L > 0.9 when background L < 0.25 |
| Hue drift threshold | > 10° spread across palette steps = visible drift |
| APCA body text | |Lc| >= 75 minimum, >= 90 preferred |
| APCA non-body text | |Lc| >= 60 minimum |
| WCAG 2 normal text | 4.5:1 AA, 7:1 AAA |
| Contrast fix (only when asked) | Adjust L first; preserve C and H when possible, then remeasure the rendered pair |
Common Mistakes
| Issue | Fix |
|---|---|
| Raw color bypasses the project's semantic token system | Reuse or add the correct role token in the project's existing notation |
| Isolated OKLCH value introduced into a hex/RGB codebase | Preserve the established notation unless the task includes a color-system migration |
| HSL palette ramp with hue drift | Rebuild with constant oklch hue |
| Failing contrast (check foreground vs its background using APCA) | Report the pair, its measured Lc and the threshold it misses; change colors only when asked (then adjust L, 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 created by mechanically reversing the light palette | Use the light palette as a starting point, then tune chroma and lightness and recheck every foreground/background pair |
Hex in Tailwind v4 @theme |
Convert to oklch values |
| Alpha with comma syntax | Use slash: `oklch( |
Частые вопросы
Перейдёт ли мой проект на OKLCH?
Нет. Скилл советует сохранить существующий формат цветов проекта, если вы не попросите миграцию.
Как он проверяет контраст?
Он использует проверки контраста APCA или WCAG, сообщает о любых несоответствиях и исправляет их только по вашей просьбе.
Что такое OKLCH?
Это цветовое пространство, в котором легко контролировать светлоту, насыщенность и оттенок, что помогает строить ровные палитры.
Подробности
Оригинальное описание автора
OKLCH color space and color usage for web projects. Convert hex/rgb/hsl to oklch, generate palettes, check contrast, handle gamut boundaries, theme with Tailwind v4, and apply color with meaning. Triggers on oklch, color conversion, palette generation, contrast ratio, gamut, display p3, design tokens, semantic color tokens, hue drift, chroma, dark mode colors, accent color, color meaning, light and dark appearance, increased contrast.
repo: trycompai/crm
Популярность
- Звёзды на GitHub
- 12k
- Место в рейтинге
- #11510
- Лицензия
- MIT
- Обновлён
- 01.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
ai-elements
12kПомогает агенту создавать интерфейсы ИИ-чата с готовыми компонентами для диалогов, сообщений, вывода инструментов и полей ввода запроса.
ai-sdk
12kПомогает агенту создавать функции ИИ с помощью Vercel AI SDK: генерацию текста, потоковую передачу, вызов инструментов и агентов.
better-accessibility
12kПомогает агенту сделать интерфейсы удобными для клавиатуры и программ чтения с экрана: фокус, подписи, ARIA и формы.
better-auth-best-practices
12kПомогает агенту настроить Better Auth для входа, сессий, OAuth и плагинов в приложении TypeScript по его документированным шагам.
Похожие скиллы
brand-discovery
280kПомогает определить айдентику бренда через структурированное интервью и составляет полный гайд с миссией, аудиторией и характером бренда.
brand-voice
280kСоставляет профиль стиля по настоящим текстам бренда, чтобы контент и коммуникации звучали единообразно и естественно.
design-md
260kУчит агента писать, проверять и экспортировать файл DESIGN.md, в котором перечислены цвета, шрифты и стиль бренда в виде, который могут читать ИИ-инструменты.