Sub topic 8
Pick a color palette and imagery
This chapter covers the color and imagery decisions that turn a gray wireframe into a styled design. It assumes you have a low-fidelity wireframe with a ranked information hierarchy, and that you know basic design-tool and CSS vocabulary. Color is applied after structure on purpose. Color should reinforce the hierarchy you already built, not create a new one.
What color has to do on a homepage
Color does four jobs on a homepage:
- It identifies the brand.
- It marks what is interactive, such as links and buttons.
- It separates sections.
- It signals state, such as error, success, and focus.
A palette that serves all four jobs is small and organized by role. A palette of "colors I like" usually fails because nothing tells you which color to use where.
Start from the primary call to action you defined at the beginning. The accent color exists mainly to make that action stand out. If the accent also appears on decorative icons, section backgrounds, and three other buttons, the primary action loses its distinction.
Build the palette by role
A workable homepage palette has these roles:
| Role | Purpose | Typical count |
|---|---|---|
| Text | Body copy and headings | 1 to 2 shades |
| Background | Page and section surfaces | 2 to 3 shades |
| Accent | Primary button, key links | 1 color, plus hover and pressed shades |
| Neutral | Borders, dividers, disabled states | 3 to 5 shades |
| Feedback | Error, success, warning | 1 each, used sparingly |
This follows a common proportion rule of thumb, often called 60-30-10. Roughly 60 percent of the surface is background, 30 percent is secondary surfaces and text, and 10 percent is accent. The ratios are a starting point, not a requirement. The useful idea is that the accent should be scarce.
Choose the accent first
Pick the accent, then derive the rest around it:
- Choose a hue that fits the brand and the audience. Check it against your goals: a finance product and a children's game need different tones.
- Generate lighter and darker steps of that hue for hover, pressed, and tinted-background states.
- Choose neutrals. Pure gray works, but neutrals tinted slightly toward the accent hue often look more cohesive.
- Pick text and background colors that pass contrast checks (covered below).
Express the palette as variables
Record each decision as a named value so that it can be reused. Name colors by role, not by appearance. --color-accent survives a rebrand. --color-blue becomes wrong the day the accent turns green.
:root {
--color-text: #1a1a1a;
--color-text-muted: #4a4a4a;
--color-bg: #ffffff;
--color-bg-subtle: #f4f6fa;
--color-border: #d5d9e0;
--color-accent: #0b5fff;
--color-accent-hover: #0847c4;
--color-on-accent: #ffffff;
--color-error: #b3261e;
}
.button {
background: var(--color-accent);
color: var(--color-on-accent);
border: 0;
padding: 0.75rem 1.5rem;
border-radius: 0.375rem;
}
.button:hover {
background: var(--color-accent-hover);
}
.features {
background: var(--color-bg-subtle);
border-top: 1px solid var(--color-border);
}The --color-on-accent variable is easy to forget. It records which text color sits on top of the accent, so the pair is always chosen together.
Contrast is part of the palette decision
Contrast ratio compares the brightness of two colors, from 1:1 (identical) to 21:1 (black on white). The Web Content Accessibility Guidelines (WCAG) set the AA thresholds that most teams target:
| Element | Minimum ratio |
|---|---|
| Body text under about 24px, or under 19px bold | 4.5:1 |
| Large text (about 24px or larger, or 19px bold or larger) | 3:1 |
| Icons, input borders, and other interface components | 3:1 |
Test the pairs you will actually use, not individual colors. A color has no contrast on its own. Check at least these pairs:
- Text on page background
- Muted text on page background and on subtle backgrounds
- Button label on accent, in default and hover states
- Link color on page background
- Placeholder or helper text on input backgrounds
Common failures are light gray muted text, white text on a mid-tone accent such as a bright orange or light green, and text laid over photographs. The later accessibility chapter returns to full checks. Doing the pairs now saves rework, because changing an accent color after the mockup is built means touching every screen.
A related rule: never use color as the only signal. A form field that turns red on error should also show an icon or message. Roughly 1 in 12 men has some form of color vision deficiency, and a red-versus-green distinction may be invisible to them.
Dark mode and alternate themes
If the design may need a dark theme, plan for it now by using role-based names. A dark theme does not invert colors. It redefines each role. The accent usually needs a lighter shade on dark backgrounds to keep its contrast, and pure black backgrounds with pure white text can cause glare, so many designs use a near-black and a slightly dimmed white. If dark mode is out of scope, say so in the design notes. That keeps the question from reopening during handoff.
Imagery: choose images that do work
Imagery in a homepage hero or feature section should support the promise, not decorate. Ask what each image must communicate before you choose it.
| Image type | Best for | Risk |
|---|---|---|
| Product screenshot | Showing what the product does | Becomes unreadable when scaled down on mobile |
| Photograph of people | Building trust and human context | Generic stock photos feel untrustworthy |
| Illustration | Explaining abstract ideas, distinctive brand voice | Style inconsistency across sections |
| Icon set | Labeling features | Inconsistent stroke weights or sizes |
| Abstract background | Adding atmosphere | Competes with text and hurts contrast |
Keep one consistent style across the page. Mixing flat illustrations, glossy 3D renders, and candid photos makes the page look assembled from parts.
Rules for imagery that holds up
- Match the hierarchy. The hero image should not outrank the hero headline and call to action. If the eye lands on the image first and never reaches the button, the image is too dominant.
- Plan for text over images. If a headline sits on a photo, add a solid or gradient overlay behind the text, or reserve a calm area of the image for it. Test contrast against the busiest part of the image, not the quietest.
- Choose a focal point. On narrow screens, images are cropped. Decide which part of the image must survive the crop, and note it for the developer.
- Set aspect ratios. Use a small set of ratios, such as 16:9 for hero images and 1:1 for avatars. Fixed ratios keep the layout from jumping while images load.
- Respect file weight. Large hero images slow the page. Export at the largest displayed size, plus a version at twice that size for high-density screens, in a modern format such as WebP or AVIF where supported.
- Write alt text intent. Decide for each image whether it carries information (needs a text description) or is decorative (should have empty alt text). Record this in the mockup so it is not guessed later.
A short check for each image
Before placing an image, answer three questions: What does it say? Does it still say that when cropped to a phone width? Does any text sit on it, and does that text pass contrast?
How color and imagery connect to the wireframe
Return to the wireframe's ranked sections. Assign color intensity by rank:
- The hero gets the strongest treatment: the accent button, the highest contrast, and the primary image.
- Feature and proof sections use the subtle background and neutral borders so they read as supporting content.
- The footer often takes the darkest or quietest surface, signaling the end of the page.
A quick test is the squint test. Blur the mockup or step back from the screen. The areas that still stand out should be the ones ranked highest in your hierarchy. If a decorative element wins, reduce its color or size.
Common mistakes
- Too many accent colors. Each extra bright color dilutes the primary action.
- Naming by hue. Names like
--blue-500for a semantic role make rebrands and themes painful. - Checking contrast late. Fixing an inaccessible accent after the full mockup is built forces edits everywhere.
- Gray text on gray. Muted text on a subtle background is the most common AA failure.
- Stock photo as filler. If an image could be swapped for any other without changing the meaning, it is not doing work.
- Ignoring image weight. A beautiful 4 MB hero image can undo a good design on mobile connections.
Hand the decisions forward
The palette variables above feed directly into the design tokens chapter. Write down the final hex values, their roles, the tested contrast pairs, and the image rules (ratios, focal points, alt-text intent). With those recorded, the high-fidelity mockup can be assembled without reopening color choices.
Exercise
Your accent color is #f5a623 (a bright orange). Your primary button uses white text on it. Name the problem you should expect, and give two ways to fix it without abandoning the brand color.
Show answer
White on a bright, light orange usually falls below the 4.5:1 ratio needed for normal-size button text, so the label is hard to read. Verify with a contrast checker. Fixes: (1) use dark text, such as #1a1a1a, on the orange, which typically passes easily; (2) darken the orange for the button background to a deeper shade that reaches 4.5:1 with white, keeping the lighter orange for non-text decoration. Larger, bold button text could qualify for the 3:1 threshold, but dark text or a darker shade is the safer choice.
Exercise
A hero headline is placed over a photograph. The left side of the photo is a dark wall and the right side is a bright window. Where should you test contrast, and what can you do if it fails?
Show answer
Test against the brightest and busiest area the text overlaps, not the dark wall, because the headline must be readable everywhere it sits. If it fails, add a solid or gradient overlay behind the text, move the text to the calm dark area, or crop the image so the bright window is not behind the text.