UI Color Hierarchy Guide

阅读时间 8 分钟更新于 2026-06-21
📘 本文内容为英文原文,提供最准确的技术信息。中文解读和实操指南正在完善中。你也可以使用页面顶部的翻译工具。

A UI can have good colors and still feel messy. That usually happens when every token tries to do the same job. Buttons shout, links compete with headlines, charts borrow brand colors they do not need, and status badges become tiny neon signs. A hierarchy fixes that.

[💬] The trick is simple: not every color should be loud. Some colors should guide. Some should support. Some should disappear. Once the system knows which layer is which, the interface becomes easier to scan and much harder to break when the next feature ships.

基础原理

Buttons need one primary voice. If the primary CTA uses the same saturation as warning banners, users stop seeing the difference. Keep the main action color distinct, then use lower-chroma variants for secondary actions and subtle states. That way the eye lands where you want it first.

Text should stay boring on purpose. Brand color can work for links, but body text usually needs neutral ink. Pure brand blue for long paragraphs looks loud and hurts readability. A clean hierarchy gives body text, muted text, and link text different jobs instead of forcing one blue to do all three.

Surfaces need quieter colors than controls. Cards, panels, and page backgrounds should mostly support the content. If the surface is louder than the button, the button loses. A good hierarchy pushes most of the palette into the background while saving the strongest values for interaction.

Charts are their own world. Data colors should be distinct from brand and UI colors. If a product uses blue for navigation, teal for success, and purple for charts, the chart set still needs enough contrast to separate series on a legend, in grayscale, and in motion.

Status colors need structure, not just hue. Success, warning, and danger should each have a background, border, text, and icon treatment. That gives the state a hierarchy inside the hierarchy. The user gets meaning from color, but also from shape and wording.

Dark mode changes the order. In light mode, the page background can stay almost invisible. In dark mode, the surface colors carry more of the visual load. If you simply invert the palette, the hierarchy collapses. Dark mode needs new token values, not a mirror image.

真实案例

Buttons need one primary voice. If the primary CTA uses the same saturation as warning banners, users stop seeing the difference. Keep the main action color distinct, then use lower-chroma variants for secondary actions and subtle states. That way the eye lands where you want it first.

Text should stay boring on purpose. Brand color can work for links, but body text usually needs neutral ink. Pure brand blue for long paragraphs looks loud and hurts readability. A clean hierarchy gives body text, muted text, and link text different jobs instead of forcing one blue to do all three.

Surfaces need quieter colors than controls. Cards, panels, and page backgrounds should mostly support the content. If the surface is louder than the button, the button loses. A good hierarchy pushes most of the palette into the background while saving the strongest values for interaction.

Charts are their own world. Data colors should be distinct from brand and UI colors. If a product uses blue for navigation, teal for success, and purple for charts, the chart set still needs enough contrast to separate series on a legend, in grayscale, and in motion.

Status colors need structure, not just hue. Success, warning, and danger should each have a background, border, text, and icon treatment. That gives the state a hierarchy inside the hierarchy. The user gets meaning from color, but also from shape and wording.

Dark mode changes the order. In light mode, the page background can stay almost invisible. In dark mode, the surface colors carry more of the visual load. If you simply invert the palette, the hierarchy collapses. Dark mode needs new token values, not a mirror image.

Simple UI color hierarchy tokens

:root {
  --color-text: oklch(22% 0.02 255);
  --color-text-muted: oklch(44% 0.02 255);
  --color-surface: oklch(98% 0.01 255);
  --color-surface-raised: oklch(96% 0.01 255);
  --color-primary: oklch(56% 0.20 255);
  --color-primary-hover: oklch(50% 0.22 255);
  --color-success: oklch(62% 0.14 145);
  --color-warning: oklch(72% 0.16 75);
  --color-danger: oklch(58% 0.18 28);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
}

.card {
  background: var(--color-surface-raised);
  color: var(--color-text);
}

复制粘贴到项目即可使用。

测试方法

Buttons need one primary voice. If the primary CTA uses the same saturation as warning banners, users stop seeing the difference. Keep the main action color distinct, then use lower-chroma variants for secondary actions and subtle states. That way the eye lands where you want it first.

Text should stay boring on purpose. Brand color can work for links, but body text usually needs neutral ink. Pure brand blue for long paragraphs looks loud and hurts readability. A clean hierarchy gives body text, muted text, and link text different jobs instead of forcing one blue to do all three.

Surfaces need quieter colors than controls. Cards, panels, and page backgrounds should mostly support the content. If the surface is louder than the button, the button loses. A good hierarchy pushes most of the palette into the background while saving the strongest values for interaction.

Charts are their own world. Data colors should be distinct from brand and UI colors. If a product uses blue for navigation, teal for success, and purple for charts, the chart set still needs enough contrast to separate series on a legend, in grayscale, and in motion.

Status colors need structure, not just hue. Success, warning, and danger should each have a background, border, text, and icon treatment. That gives the state a hierarchy inside the hierarchy. The user gets meaning from color, but also from shape and wording.

Dark mode changes the order. In light mode, the page background can stay almost invisible. In dark mode, the surface colors carry more of the visual load. If you simply invert the palette, the hierarchy collapses. Dark mode needs new token values, not a mirror image.

💡 高手技巧

工具推荐

Buttons need one primary voice. If the primary CTA uses the same saturation as warning banners, users stop seeing the difference. Keep the main action color distinct, then use lower-chroma variants for secondary actions and subtle states. That way the eye lands where you want it first.

Text should stay boring on purpose. Brand color can work for links, but body text usually needs neutral ink. Pure brand blue for long paragraphs looks loud and hurts readability. A clean hierarchy gives body text, muted text, and link text different jobs instead of forcing one blue to do all three.

Surfaces need quieter colors than controls. Cards, panels, and page backgrounds should mostly support the content. If the surface is louder than the button, the button loses. A good hierarchy pushes most of the palette into the background while saving the strongest values for interaction.

Charts are their own world. Data colors should be distinct from brand and UI colors. If a product uses blue for navigation, teal for success, and purple for charts, the chart set still needs enough contrast to separate series on a legend, in grayscale, and in motion.

Status colors need structure, not just hue. Success, warning, and danger should each have a background, border, text, and icon treatment. That gives the state a hierarchy inside the hierarchy. The user gets meaning from color, but also from shape and wording.

Dark mode changes the order. In light mode, the page background can stay almost invisible. In dark mode, the surface colors carry more of the visual load. If you simply invert the palette, the hierarchy collapses. Dark mode needs new token values, not a mirror image.

免费工具推荐

用这些免费工具实操你学到的知识: