When to Use
Use when color is the real decision surface: palette building, semantic tokens, dark mode, chart colors, brand systems, accessibility, print handoff, or image/export consistency.
If the job is context-specific, load the matching file before locking the palette:
- -
ui-systems.md for product UI, design systems, semantic tokens, states, surfaces, and dark mode. - INLINECODE1 for palette construction, neutrals, accents, tonal ladders, and brandable combinations.
- INLINECODE2 for contrast, non-color cues, text legibility, and state signaling.
- INLINECODE3 for categorical vs sequential scales, heatmaps, dashboards, and chart-safe colors.
- INLINECODE4 for brand palettes, campaigns, logos, packaging, and cross-channel consistency.
- INLINECODE5 for CMYK, spot colors, proofs, coated vs uncoated stock, and prepress handoff.
- INLINECODE6 for RGB/HEX/HSL/HSV/LAB/OKLab/OKLCH decisions and conversion traps.
- INLINECODE7 when the user needs concrete code, CSS tokens, or command-line conversions.
Keep the system-level workflow in this file, then pull in the specialized file that matches the real output instead of solving every color problem with generic palette advice.
Quick Reference
| Situation | Load | Why |
|---|
| Product UI, theming, semantic states, dark mode | INLINECODE8 | Prevent token drift, weak states, and inconsistent surfaces |
| Palette ideation, tonal ramps, neutrals, accent strategy |
palettes.md | Build palettes that scale instead of isolated swatches |
| Text contrast, alerts, status chips, colorblind-safe design |
accessibility.md | Keep color usable, legible, and compliant in context |
| Charts, maps, dashboards, categorical or sequential scales |
data-viz.md | Avoid misleading charts and indistinguishable series |
| Brand systems, campaigns, packaging, logo environments |
branding.md | Preserve brand recognition across surfaces and sizes |
| Print production, proofs, CMYK, spot inks, material shifts |
print.md | Avoid screen-to-print surprises and prepress mistakes |
| RGB, CMYK, LAB, OKLCH, conversions, gamut, interpolation |
color-spaces.md | Pick the right space for design, editing, and export |
| CSS, design tokens, JS helpers, conversion commands |
commands.md | Use concrete implementations once the strategy is clear |
Fast Workflow
- 1. Identify the job type: UI system, palette exploration, chart, brand surface, image treatment, or print handoff.
- Identify the destination: app UI, marketing page, charting library, social graphic, packaging, PDF, or press output.
- Decide what color must do: guide hierarchy, encode state, separate data, express brand, improve readability, or survive production.
- Inspect existing constraints before changing anything: current palette, token names, contrast, background shifts, export format, gamut, and theme variants.
- Load the destination-specific file if the work is product UI, palette design, accessibility, data viz, branding, print, or color-space heavy.
- Make the minimum color decisions that keep the whole system coherent: neutrals, accent count, state mapping, tonal steps, and conversion/export rules.
- Validate the result in the actual context: light and dark, disabled and hover, chart legend, image overlay, browser preview, and printed proof when relevant.
Color-Job Defaults
| Job | Usually best starting point | Watch out for |
|---|
| Product UI theme | Neutral ladder + one primary + defined semantic states | Token drift, weak disabled states, dark-mode collapse |
| Marketing palette |
Brand anchor + controlled accent pair + support neutrals | Too many accents, campaign colors overpowering brand |
| Dashboard or chart | Distinct categorical set or ordered sequential ramp | Color-only meaning, low-contrast lines, legend confusion |
| Image overlays or captions | Neutral text with overlay/backplate and one accent | Beautiful mockups that fail on real photos |
| Print piece or packaging | Approved print palette with proofed conversions | CMYK dulling, stock shift, out-of-gamut brand colors |
| Design-token refactor | Semantic roles mapped to stable primitives | Naming by hue instead of intent |
| Accessibility cleanup | Contrast-safe neutrals and state patterns first | Chasing AA numbers while meaning still depends on color |
Core Rules
1. Choose colors by job, not by taste
- - A background color, brand accent, error state, chart series, and print ink are different jobs.
- If the palette has to handle hierarchy, status, and data at once, separate those responsibilities before adding more colors.
- The best-looking swatch in isolation can still fail when it has to carry text, hover states, or category meaning.
- Start by defining what each color must do in the interface or asset, not what hue feels fashionable.
- If a color has no clear role, it is probably noise.
2. Build the system before polishing the palette
- - A color system needs primitives, semantic roles, and component-level usage, not only named swatches.
- Neutrals usually carry more of the product than the accent color does, so define the neutral ladder early.
- A palette that looks balanced on a moodboard can still fail when applied to buttons, borders, tables, banners, and empty states.
- Use accents deliberately; more accent colors usually create weaker hierarchy, not richer design.
- If the job spans multiple products or channels, define reuse rules before designing edge-case surfaces.
3. Use perceptual spaces for ramps and interpolation
- - RGB and HSL are convenient, but they do not always create visually even steps.
- OKLCH or OKLab are better starting points when the task needs predictable lightness steps, tonal ramps, and theme derivations.
- HSL remains useful for fast exploration, but do not assume equal HSL steps look equally bright.
- Conversion is not neutral: a color that looks stable in one space can shift when moved into another gamut or output format.
- If a system needs scalable ramps, trust perceptual spacing more than eyeballing random hex values.
4. Contrast is contextual, not just a ratio
- - Contrast checks for text, UI boundaries, icons, charts, and overlays are related but not identical jobs.
- Passing AA on one background does not mean the same foreground works on tinted cards, photos, hover states, or dark surfaces.
- A state color that "reads fine" in a mockup can disappear inside disabled, pressed, or selected variants.
- Thin type, small labels, chart lines, and over-photo text fail faster than large blocks of text.
- Measure contrast, but also validate the real composition where the color will be used.
5. Never let meaning depend on color alone
- - Status, validation, category, and priority should still work in grayscale, low vision, and low-quality displays.
- Pair color with text, shape, iconography, pattern, position, or motion when the distinction matters.
- Sequential and diverging chart scales need labels and legends that remain understandable without perfect hue perception.
- Red and green can coexist, but they cannot be the only signal.
- If the user would lose the meaning when the color is removed, the system is underspecified.
6. Validate the whole state matrix, not the hero screen
- - Palettes break in edges: disabled buttons, hover backgrounds, table striping, empty charts, skeletons, and on-image captions.
- Dark mode needs a deliberate surface strategy; simply inverting colors usually destroys hierarchy.
- Brand colors that work for headlines can fail for body text, borders, or small icons.
- Charts need validation at line thickness, marker size, and dashboard density, not only in a polished presentation slide.
- If the system ships across web, mobile, image exports, and PDF, validate each medium before calling it stable.
7. Treat color management as a real production constraint
- - Display RGB, exported PNG, social upload, PDF, and press sheet can all move the same color differently.
- sRGB is still the safest default for most digital delivery, but not every workflow ends there.
- Print introduces CMYK conversion, ink limits, substrate shift, and proofing requirements that a screen mockup hides.
- Image assets, CSS colors, and chart libraries can each interpret the same value differently when profiles or rendering assumptions diverge.
- If the job crosses digital and print, define the handoff rules explicitly instead of trusting one set of hex codes to survive everything.
8. Make tokens semantic and naming durable
- - Name colors by role or outcome, not by the hue of the moment.
- INLINECODE16 ,
surface-muted, and status-danger age better than blue-700-button. - Keep primitives stable underneath semantics so a rebrand does not require renaming the entire component layer.
- One-off overrides multiply quickly; if a component needs a special token, document why it exists.
- Durable naming matters more than any single hex choice when the system will evolve.
Specialized Cases Worth Loading
- - Load
ui-systems.md when the work touches buttons, surfaces, forms, alerts, dark mode, or design tokens. - Load
data-viz.md when the output includes charts, maps, dashboards, scorecards, or category comparisons. - Load
print.md when the asset will become a poster, packaging file, brochure, label, PDF proof, or press-ready export. - Load
branding.md when the question is about brand recognition, campaign palettes, logos, packaging, or social consistency.
What Good Looks Like
- - Every important color has a clear role and survives the surfaces where it is used.
- The neutral system, accent strategy, and semantic states feel related instead of assembled from disconnected swatches.
- Text, icons, charts, and overlays stay legible in the real preview, not only in the ideal mockup.
- Token names express function, so future changes can swap values without rewriting the whole system.
- Color ramps look visually even instead of randomly jumping in brightness.
- The design still works in grayscale, dark mode, tinted surfaces, and after export or print conversion.
- The agent has not confused pleasing colors with a complete color system.
Common Traps
- - Starting with an accent color and improvising everything else afterward.
- Naming tokens by hue and locking the design system to this quarter's palette.
- Treating contrast as solved because one text/background pair passes a checker.
- Designing categorical charts with hues that collapse for colorblind users or at small line widths.
- Using brand colors for body copy when they were only safe for display-sized headlines.
- Building ramps in RGB or HSL and assuming equal code steps mean equal perceived steps.
- Solving state communication with red and green alone.
- Forgetting that tinted cards, overlays, and dark mode change contrast math and perception.
- Assuming screen colors will print faithfully without proofing or conversion decisions.
- Exporting gorgeous color palettes that have no neutral strategy, state mapping, or component rules behind them.
Related Skills
Install with
clawhub install <slug> if user confirms:
- -
image — Image processing, exports, and color-sensitive visual asset workflows. - INLINECODE26 — AI image creation where palette, art direction, and color consistency matter.
- INLINECODE27 — Brand-system decisions beyond color alone.
- INLINECODE28 — Capture, grading, and print-aware image workflows where color intent matters.
- INLINECODE29 — Vector graphics workflows where palette discipline and contrast affect brand delivery.
Feedback
- - If useful: INLINECODE30
- Stay updated: INLINECODE31
何时使用
当颜色是真正的决策面时使用:调色板构建、语义令牌、深色模式、图表颜色、品牌系统、无障碍设计、印刷交接,或图像/导出一致性。
如果任务具有特定上下文,在锁定调色板之前加载匹配的文件:
- - ui-systems.md 用于产品 UI、设计系统、语义令牌、状态、表面和深色模式。
- palettes.md 用于调色板构建、中性色、强调色、色调阶梯和可品牌化的组合。
- accessibility.md 用于对比度、非颜色提示、文本易读性和状态信号。
- data-viz.md 用于分类与顺序尺度、热力图、仪表盘和图表安全颜色。
- branding.md 用于品牌调色板、活动、标志、包装和跨渠道一致性。
- print.md 用于 CMYK、专色、打样、光面与哑光纸张、印前交接。
- color-spaces.md 用于 RGB/HEX/HSL/HSV/LAB/OKLab/OKLCH 决策和转换陷阱。
- commands.md 当用户需要具体代码、CSS 令牌或命令行转换时。
将系统级工作流保留在此文件中,然后引入与真实输出匹配的专门文件,而不是用通用的调色板建议解决所有颜色问题。
快速参考
| 情况 | 加载 | 原因 |
|---|
| 产品 UI、主题化、语义状态、深色模式 | ui-systems.md | 防止令牌漂移、弱状态和不一致的表面 |
| 调色板构思、色调渐变、中性色、强调色策略 |
palettes.md | 构建可扩展的调色板,而非孤立的色块 |
| 文本对比度、警报、状态标签、色盲安全设计 | accessibility.md | 保持颜色在上下文中可用、易读且合规 |
| 图表、地图、仪表盘、分类或顺序尺度 | data-viz.md | 避免误导性图表和无法区分的系列 |
| 品牌系统、活动、包装、标志环境 | branding.md | 跨表面和尺寸保持品牌识别度 |
| 印刷生产、打样、CMYK、专色油墨、材料变化 | print.md | 避免屏幕到印刷的意外和印前错误 |
| RGB、CMYK、LAB、OKLCH、转换、色域、插值 | color-spaces.md | 为设计、编辑和导出选择正确的空间 |
| CSS、设计令牌、JS 辅助工具、转换命令 | commands.md | 策略明确后使用具体实现 |
快速工作流
- 1. 识别任务类型:UI 系统、调色板探索、图表、品牌表面、图像处理或印刷交接。
- 识别目标:应用 UI、营销页面、图表库、社交媒体图形、包装、PDF 或印刷输出。
- 决定颜色必须做什么:引导层级、编码状态、区分数据、表达品牌、提高可读性或适应生产。
- 在更改任何内容之前检查现有约束:当前调色板、令牌名称、对比度、背景变化、导出格式、色域和主题变体。
- 如果工作是产品 UI、调色板设计、无障碍设计、数据可视化、品牌、印刷或颜色空间密集型,则加载目标特定文件。
- 做出保持整个系统连贯的最小颜色决策:中性色、强调色数量、状态映射、色调步骤和转换/导出规则。
- 在实际上下文中验证结果:浅色和深色、禁用和悬停、图表图例、图像叠加、浏览器预览,以及相关时的印刷打样。
颜色任务默认值
| 任务 | 通常最佳起点 | 注意 |
|---|
| 产品 UI 主题 | 中性色阶梯 + 一个主色 + 定义的语义状态 | 令牌漂移、弱禁用状态、深色模式崩溃 |
| 营销调色板 |
品牌锚点 + 受控的强调色对 + 支持中性色 | 过多强调色、活动颜色压倒品牌 |
| 仪表盘或图表 | 独特的分类集或有序的顺序渐变 | 仅依赖颜色含义、低对比度线条、图例混淆 |
| 图像叠加或标题 | 带叠加/背板的中性色文本和一个强调色 | 在真实照片上失败的漂亮模型 |
| 印刷品或包装 | 经批准的印刷调色板及打样转换 | CMYK 变暗、纸张变化、品牌颜色超出色域 |
| 设计令牌重构 | 语义角色映射到稳定的基元 | 按色相而非意图命名 |
| 无障碍清理 | 首先使用对比度安全的中性色和状态模式 | 追求 AA 数值而含义仍依赖颜色 |
核心规则
1. 按任务选择颜色,而非凭喜好
- - 背景色、品牌强调色、错误状态、图表系列和印刷油墨是不同的任务。
- 如果调色板必须同时处理层级、状态和数据,在添加更多颜色之前先分离这些职责。
- 孤立状态下最好看的色块在承载文本、悬停状态或类别含义时仍可能失败。
- 首先定义每种颜色在界面或资产中必须做什么,而不是什么色相感觉时尚。
- 如果一种颜色没有明确角色,它很可能是噪音。
2. 在打磨调色板之前先构建系统
- - 颜色系统需要基元、语义角色和组件级用法,而不仅仅是命名的色块。
- 中性色通常比强调色承载更多产品内容,因此尽早定义中性色阶梯。
- 在情绪板上看起来平衡的调色板应用于按钮、边框、表格、横幅和空状态时仍可能失败。
- 有目的地使用强调色;更多强调色通常创造更弱的层级,而非更丰富的设计。
- 如果任务跨越多个产品或渠道,在设计边缘案例表面之前定义重用规则。
3. 使用感知空间进行渐变和插值
- - RGB 和 HSL 很方便,但并不总能创建视觉上均匀的步骤。
- 当任务需要可预测的明度步骤、色调渐变和主题衍生时,OKLCH 或 OKLab 是更好的起点。
- HSL 对于快速探索仍然有用,但不要假设相等的 HSL 步骤看起来同样明亮。
- 转换并非中性:在一个空间中看起来稳定的颜色在移动到另一个色域或输出格式时可能会变化。
- 如果系统需要可扩展的渐变,信任感知间距胜过目测随机十六进制值。
4. 对比度是上下文相关的,而不仅仅是一个比率
- - 文本、UI 边界、图标、图表和叠加层的对比度检查是相关但不同的任务。
- 在一个背景上通过 AA 并不意味着相同的前景色在着色卡片、照片、悬停状态或深色表面上也有效。
- 在模型中看起来还行的状态颜色可能在禁用、按下或选中变体中消失。
- 细字体、小标签、图表线条和照片上的文本比大块文本更快失效。
- 测量对比度,但也要验证颜色将实际使用的真实构图。
5. 永远不要让含义仅依赖颜色
- - 状态、验证、类别和优先级在灰度、低视力和低质量显示中仍应有效。
- 当区分重要时,将颜色与文本、形状、图标、图案、位置或动效配对。
- 顺序和发散图表尺度需要标签和图例,在没有完美色相感知的情况下仍可理解。
- 红色和绿色可以共存,但它们不能是唯一的信号。
- 如果用户移除颜色后会失去含义,则系统定义不足。
6. 验证整个状态矩阵,而非主屏幕
- - 调色板在边缘处断裂:禁用按钮、悬停背景、表格条纹、空图表、骨架屏和图像上的标题。
- 深色模式需要有意的表面策略;简单地反转颜色通常会破坏层级。
- 适用于标题的品牌颜色可能对正文文本、边框或小图标失效。
- 图表需要在线条粗细、标记大小和仪表盘密度下验证,而不仅仅在精美的演示幻灯片中。
- 如果系统跨 Web、移动端、图像导出和 PDF 发布,在称其稳定之前验证每种媒介。
7. 将颜色管理视为真实的生产约束
- - 显示 RGB、导出的 PNG、社交媒体上传、PDF 和印刷纸张都可能以不同方式移动相同颜色。
- sRGB 对于大多数数字交付仍然是最安全的默认值,但并非每个工作流都止步于此。
- 印刷引入了 CMYK 转换、油墨限制、基材变化和打样要求,这些是屏幕模型隐藏的。
- 当配置文件或渲染假设不同时,图像资产、CSS 颜色和图表库可能以不同方式解释相同值。
- 如果任务跨越数字和印刷,明确定义交接规则,而不是信任一组十六进制代码能应对一切。
8. 使令牌具有语义性,命名持久耐用
- - 按角色或结果命名颜色,而不是按当下的色相。
- text-primary、surface-muted 和 status-danger 比 blue-700-button 更经得起时间考验。
- 在语义层下保持基元稳定,以便品牌重塑不需要重命名整个