Color in UI
Color in UI supports hierarchy, identity, feedback, and state while maintaining contrast and ensuring meaning never depends on color alone.
Download Markdown (.md)Soroush’s Product Wiki · https://wiki.soroush.uk/topic/color-in-ui/
01What 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.[1][2][3]
02Why 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.
03When 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.
04How it works
- Define semantic roles and tokens separately from raw palette names.
- Choose text and interface pairs that meet required contrast in every state and theme.
- Pair color-coded meaning with labels, icons, patterns, or position.
- Reserve strong accents for priority and keep focus indicators visible.
- Test color-vision simulations, forced colors, dark mode, displays, and real content.
05A 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.
06Where 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
07Sources
- ColorApple Human Interface Guidelines · Institutional guidelineColor
- Understanding SC 1.4.3: Contrast (Minimum)W3C Web Accessibility Initiative · Accessibility guidanceUnderstanding SC 1.4.3: Contrast (Minimum)
- Understanding SC 1.4.1: Use of ColorW3C Web Accessibility Initiative · Accessibility guidanceUnderstanding SC 1.4.1: Use of Color