# Color in UI

Color in UI supports hierarchy, identity, feedback, and state while maintaining contrast and ensuring meaning never depends on color alone.

- Type: practice
- Domain: Experience & interface
- Level: Foundational
- Last reviewed: 2026-09-21
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/color-in-ui/>)

## What it means

Color in UI is a semantic system, not a collection of favorite swatches. It assigns roles such as surface, text, border, accent, success, warning, and danger, then defines behavior across themes and interaction states. Effective systems account for contrast, color-vision differences, conditions, and user settings.

## Why it matters

Color can make scanning faster and status easier to recognize, but poor use hides content or excludes users. Semantic tokens let teams change themes and meet contrast needs without rewriting components. Redundant cues keep meaning available when hue is not perceived.

## When to use it

Use color deliberately in every component and state, including hover, focus, selected, disabled, error, charts, and dark or high-contrast themes. Verify actual foreground-background pairs and non-text boundaries, not isolated palette values, before release.

## How it works

1. Define semantic roles and tokens separately from raw palette names.
2. Choose text and interface pairs that meet required contrast in every state and theme.
3. Pair color-coded meaning with labels, icons, patterns, or position.
4. Reserve strong accents for priority and keep focus indicators visible.
5. Test color-vision simulations, forced colors, dark mode, displays, and real content.

## A practical example

A monitoring dashboard uses semantic status tokens in light and dark themes. Critical alerts combine high-contrast color with an icon and “Critical” label. Chart series differ in hue and line style, and focus rings remain visible on each surface.

## Where it breaks

Contrast conformance does not automatically make a palette comfortable or understandable. Font weight, glare, display quality, and adjacent colors affect perception. Too many semantic colors create inconsistency, while automatic theme transforms can produce invalid combinations. Test rendered states.

## Common mistakes

- Encoding status or chart series by hue alone
- Checking palette swatches but not component states
- Using low contrast to make secondary content quiet

## Sources

1. [Color](<https://developer.apple.com/design/human-interface-guidelines/color>) — Apple Human Interface Guidelines · Institutional guideline
2. [Understanding SC 1.4.3: Contrast \(Minimum\)](<https://www.w3.org/WAI/WCAG22/Understanding/contrast-minimum.html>) — W3C Web Accessibility Initiative · Accessibility guidance
3. [Understanding SC 1.4.1: Use of Color](<https://www.w3.org/WAI/WCAG22/Understanding/use-of-color.html>) — W3C Web Accessibility Initiative · Accessibility guidance

## Related topics

- [Visual Hierarchy](<https://wiki.soroush.uk/topic/visual-hierarchy/>)
- [Typography in UI](<https://wiki.soroush.uk/topic/typography-in-ui/>)
- [Accessibility](<https://wiki.soroush.uk/topic/accessibility/>)
