Color Theory & Application

Color drives emotion, directs attention, and communicates meaning faster than text. A well-chosen palette makes a product feel professional and trustworthy. A poor one makes it feel cheap or confusing, even if everything else is well-designed.

The 60-30-10 Rule

The most reliable formula for color distribution. It creates balance without requiring design intuition.

┌─────────────────────────────────────────────────────┐
│                                                     │
│   60% DOMINANT                                      │
│   (Background, large surfaces)                      │
│                                                     │
│   ┌─────────────────────────────┐                   │
│   │                             │                   │
│   │   30% SECONDARY             │                   │
│   │   (Cards, sidebars, nav)    │                   │
│   │                             │                   │
│   │   ┌─────────────┐          │                   │
│   │   │ 10% ACCENT  │          │                   │
│   │   │ (CTAs, links)│          │                   │
│   │   └─────────────┘          │                   │
│   └─────────────────────────────┘                   │
└─────────────────────────────────────────────────────┘

In practice:

RatioRoleTypical UsageExample (Light Theme)
60%DominantPage background, large areasWhite (#FFFFFF) or off-white (#F8F9FA)
30%SecondaryCards, sidebars, input backgrounds, sectionsLight gray (#F1F3F5) or white on gray bg
10%AccentButtons, links, active states, iconsBrand blue (#0066CC)

Common mistake: Using the accent color too much. If your brand color covers 30%+ of the screen, it's overwhelming. The accent is powerful because it's rare.

Color Psychology

Color associations are culturally influenced but these hold broadly for Western audiences:

ColorAssociationsCommon UseExamples
BlueTrust, security, calm, professionalismBanking, healthcare, corporate, techFacebook, PayPal, Salesforce
GreenGrowth, nature, success, moneyFinance, eco-friendly, confirmationsRobinhood, Spotify, WhatsApp
RedUrgency, passion, danger, energyErrors, sales, alerts, foodYouTube, Netflix, Coca-Cola
OrangeEnergy, enthusiasm, warmthCTAs, warnings, playful brandsAmazon (button), HubSpot
YellowOptimism, attention, cautionHighlights, warnings, casual brandsSnapchat, Post-it, warning signs
PurpleLuxury, creativity, wisdomPremium products, creative toolsTwitch, Cadbury, Hallmark
BlackElegance, power, sophisticationLuxury brands, typography-heavyApple, Nike, Chanel
WhiteClean, minimal, spaceBackgrounds, breathing roomApple, Google, modern SaaS
PinkPlayful, youthful, romanticConsumer products, lifestyleT-Mobile, Dribbble, Lyft
TealCalm creativity, modernSaaS, healthcare, wellnessCanva, TikTok

Important: Don't choose colors based on psychology alone. Choose based on your brand identity, then check that the psychological associations don't conflict.

Building a Color Palette

Required Palette Colors

Every product needs at minimum:

BRAND COLORS:
  Primary:      Main brand color (used for CTAs, links, key actions)
  Secondary:    Supporting brand color (used for secondary elements)

NEUTRAL PALETTE:
  Gray-50:      Lightest (backgrounds)
  Gray-100:     Light (card backgrounds, borders)
  Gray-200:     Light (dividers, disabled backgrounds)
  Gray-300:     Medium-light (borders, icons)
  Gray-400:     Medium (placeholder text — check contrast!)
  Gray-500:     Medium-dark (secondary text)
  Gray-600:     Dark (body text)
  Gray-700:     Darker (headings)
  Gray-800:     Very dark (primary headings)
  Gray-900:     Darkest (high-emphasis text)

SEMANTIC COLORS:
  Success:      Green — positive states, confirmations
  Warning:      Yellow/Orange — caution, non-critical alerts
  Error:        Red — problems, destructive actions
  Info:         Blue — informational messages, tips

Generating Color Variants

Each color needs a range from light (for backgrounds) to dark (for text on light backgrounds):

:root {
  /* Primary — Blue */
  --primary-50:  #EBF5FF;  /* Backgrounds, selected row highlight */
  --primary-100: #CCE5FF;  /* Light badge backgrounds */
  --primary-200: #99CCFF;  /* Light borders */
  --primary-300: #66B2FF;  /* Icons on light backgrounds */
  --primary-400: #3399FF;  /* Secondary buttons */
  --primary-500: #0066CC;  /* Base — primary buttons, links */
  --primary-600: #0052A3;  /* Hover state */
  --primary-700: #003D7A;  /* Active/pressed state */
  --primary-800: #002952;  /* Dark backgrounds */
  --primary-900: #001429;  /* Darkest — text on light backgrounds */

  /* Error — Red */
  --error-50:  #FFF5F5;  /* Error background */
  --error-100: #FFE3E3;  /* Error badge background */
  --error-500: #E03131;  /* Error text, icons */
  --error-600: #C92A2A;  /* Error hover */
  --error-700: #A61E1E;  /* Error dark text */

  /* Success — Green */
  --success-50:  #F0FFF4;
  --success-100: #C6F6D5;
  --success-500: #38A169;
  --success-600: #2F855A;
  --success-700: #276749;
}

Tools for generating variants:

  • Tailwind CSS Colors: pre-built palettes with 50-950 shades
  • Realtime Colors (realtimecolors.com): preview palette on a live page
  • Coolors (coolors.co): generate harmonious palettes
  • Huemint: AI-powered palette generation
  • ColorBox by Lyft: systematic shade generation

Color Harmony Methods

MethodDescriptionWhen to Use
MonochromaticOne hue, different lightness/saturationSafe, cohesive. Best for minimalist brands.
ComplementaryTwo hues opposite on the color wheelHigh contrast. Good for accent + primary.
Analogous2-3 adjacent hues on the color wheelHarmonious, natural. Low contrast.
TriadicThree hues equally spaced (120° apart)Vibrant, playful. Hard to balance.
Split-complementaryOne hue + two adjacent to its complementLess tension than complementary. Versatile.

For most product interfaces, monochromatic + one accent or complementary palettes are the safest choices. Save triadic and complex harmonies for brand/marketing work.

Contrast Requirements (WCAG 2.2)

These aren't guidelines, they're legal requirements in many jurisdictions. Get them right.

ElementMinimum Ratio (AA)Enhanced Ratio (AAA)
Normal text (<18pt)4.5:17:1
Large text (18pt+ or 14pt+ bold)3:14.5:1
UI components (borders, icons)3:1N/A
Non-text graphics3:1N/A

Common Contrast Failures

SituationTypical RatioFix
Light gray text on white (#999 on #FFF)2.8:1 (FAIL)Darken to #767676 or darker
Placeholder text (#BBB on #FFF)1.9:1 (FAIL)Use #767676 minimum, or use visible labels instead
White text on yellow buttonOften <3:1 (FAIL)Use dark text on yellow, or darken the yellow
Blue link on blue backgroundVaries, often FAILEnsure underline or sufficient contrast
Disabled text (#CCC on #FFF)1.6:1 (technically exempt)Still try for 2:1+ minimum for usability

Tools for checking contrast:

  • WebAIM Contrast Checker (webaim.org/resources/contrastchecker)
  • Stark (Figma/Sketch plugin)
  • Colour Contrast Analyser (desktop app)
  • Chrome DevTools: Inspect element, the color picker shows contrast ratio

Testing Shortcut

Memorize this: #767676 on #FFFFFF = exactly 4.5:1. Any gray darker than #767676 passes for normal text on white.

Semantic Color Usage

Colors should communicate meaning consistently:

MeaningColorUsageNever Use For
Success/PositiveGreenConfirmations, saved states, completed stepsErrors, warnings
Error/DangerRedValidation errors, destructive actions, alertsSuccess states, brand decoration
Warning/CautionYellow/AmberNon-blocking alerts, expiring itemsErrors (too subtle), success
Info/NeutralBlueTips, informational banners, help textErrors (confusing with links)
DisabledGray (lower opacity)Inactive elements, unavailable actionsActive or important elements

Critical rule: Never use color as the only indicator of meaning. Always pair with text, icons, or patterns. 8% of men are colorblind.

BAD (color only):
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
│  Green border  │ │  Yellow border │ │   Red border   │
│  (passed)      │ │  (warning)     │ │   (failed)     │
└────────────────┘ └────────────────┘ └────────────────┘

GOOD (color + icon + text):
┌────────────────┐ ┌────────────────┐ ┌────────────────┐
│ ✓ Passed       │ │ ⚠ Warning      │ │ ✗ Failed       │
│  Green border  │ │  Yellow border │ │   Red border   │
└────────────────┘ └────────────────┘ └────────────────┘

Dark Mode

Dark mode isn't "invert all the colors." It requires deliberate design.

Dark Mode Principles

PrincipleLight ModeDark Mode
BackgroundWhite (#FFFFFF)Not black; use #121212 to #1E1E1E
Surface/CardsLight gray (#F5F5F5)Slightly lighter than bg (#1E1E1E to #2C2C2C)
Primary textNear-black (#1A1A1A)Off-white (#E0E0E0 to #F0F0F0)
Secondary textDark gray (#666666)Medium gray (#A0A0A0 to #B0B0B0)
Accent colorsFull saturationDesaturate by 10-20%
ContrastStandardSlightly reduce (avoid glowing white text on dark)
ElevationShadows get darkerSurfaces get lighter (lighter = higher elevation)

Dark Mode CSS

/* Using CSS custom properties for easy theming */
:root {
  --bg-primary: #FFFFFF;
  --bg-surface: #F5F5F5;
  --text-primary: #1A1A1A;
  --text-secondary: #666666;
  --accent: #0066CC;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #121212;
    --bg-surface: #1E1E1E;
    --text-primary: #E0E0E0;
    --text-secondary: #A0A0A0;
    --accent: #4D9FFF;  /* Lighter/desaturated for dark bg */
  }
}

Dark Mode Mistakes

MistakeWhy It FailsFix
Pure black (#000) backgroundToo harsh, causes "halation" (bright text blooms)Use #121212 - #1A1A1A
Pure white (#FFF) textToo much contrast, eye strainUse #E0E0E0 - #F0F0F0
Same accent color as light modeSaturated colors vibrate on dark backgroundsLighten and desaturate by 10-20%
Using shadows for elevationShadows invisible on dark backgroundsUse lighter surface colors for elevation
Not testing imagesImages with white backgrounds look wrongAdd subtle rounded corners and borders, or use transparent PNGs

Color in Data Visualization

When using color to represent data, follow these guidelines:

GuidelineExplanation
Sequential paletteLight → dark for low → high values (one hue)
Diverging paletteTwo hues meeting at neutral for above/below a midpoint
Categorical paletteDistinct hues for different categories (max 6-8)
Colorblind-safeAvoid red-green distinctions. Use blue-orange instead.
Meaningful defaultsRed = bad, green = good, gray = neutral
Sequential:    ░░░░ ▒▒▒▒ ▓▓▓▓ ████  (light blue → dark blue)
Diverging:     ████ ▓▓▓▓ ░░░░ ▓▓▓▓ ████  (red → white → blue)
Categorical:   ████ ████ ████ ████ ████  (5 distinct hues)

Common Mistakes

MistakeImpactFix
Too many colorsOverwhelming, unprofessionalStick to 60-30-10. Use grays for most things.
No semantic consistencyRed sometimes means error, sometimes means "sale"Define semantic meanings and never break them
Ignoring colorblindness8% of male users can't distinguish red/greenAlways pair color with icons or text. Test with colorblind simulators.
Brand color for everythingKey actions blend in when everything is brandedUse brand color sparingly, primarily for CTAs and links
Skipping contrast testingText unreadable in certain conditionsCheck every text/background combination with WebAIM
Different blues for links vs. buttonsUsers can't tell what's clickableUse one primary blue for all interactive elements

Key Takeaways

  • Apply 60-30-10: most of the screen is neutral, 30% secondary, 10% accent.
  • Build a complete palette: brand primary, neutral grays (50-900), semantic colors (success, warning, error, info).
  • Check contrast for every text/background pair. Memorize: #767676 on white = 4.5:1 minimum.
  • Never use color as the only way to communicate meaning. Always supplement with text or icons.
  • Dark mode isn't inverted light mode. Use off-black backgrounds, desaturated accents, and lighter surfaces for elevation.
  • Keep it simple: 1-2 brand colors, a neutral gray palette, and 4 semantic colors covers 99% of UI needs.