How to Choose Colors for Web Design | Essential Rules to Consider First
When choosing colors for a website, start with what visitors need to read first and what they should do next, rather than hunting for an attractive palette right away. A visually appealing page can still fail its purpose if key text and controls blend into their surroundings. Using a local bus timetable page as an example, this guide explains the essential decisions to make before choosing colors and the checks to perform before launch.
First, Decide Which Information Matters Before Choosing Colors
On a bus timetable page, visitors may first need to find their stop, departure time, and next available service. Only then might they check intermediate stops, service cancellations, or a route map. Write down this sequence of tasks before choosing colors. Give the most important content clear placement, readable text sizes, and appropriate spacing. Color should reinforce the reading order, not become the only way of establishing it.
Next, evaluate text and its actual background as a pair. Two colors can have different hues—their basic color families, such as blue and red—or different saturation levels, meaning vividness, yet still be difficult to distinguish if their lightness is similar. A contrast ratio measures the difference in relative luminance, or lightness, between two colors. Check each adjacent pairing, including body text, links, and buttons.
You can assign labels such as base, main, and accent to the palette afterward. For this first stage, meeting a fixed color count or area percentage is less important than making the page’s actual information and controls understandable.
Choose Colors Step by Step for a Bus Timetable Page
The values below are HEX codes, hexadecimal numbers that specify colors on the web. Imagine a screen that combines departure times, selectable stops, and service notices. We will consider the role and contrast of each color where it actually appears.
1. Start with the Background and Text Used for Departure Times
Use a light blue-gray ■#F5F7F8 as the page background, with dark blue-gray ■#24343C for departure times and paragraphs. Their contrast ratio is approximately 11.98:1. For route-name headings, use deep blue ■#235B72, which contrasts with the same background ■#F5F7F8 at approximately 6.95:1. Muted blue-gray ■#35505B can be used for stop descriptions while retaining approximately 7.98:1 against the background ■#F5F7F8.
For a critical detail like a departure time, adjust row position, font weight, and spacing before adding more colors. Avoid placing text over photographs that introduce varying lightness behind the timetable. The priority is to let readers identify the correct time, not merely to create a striking visual style.
2. Distinguish Table Row Shading from Clickable Areas
If alternating timetable rows use pale blue-gray ■#E9F0F2, the difference from the page background ■#F5F7F8 is only approximately 1.07:1. That slight change can support visual row grouping, but it should not be the only boundary defining a selectable control. Muted blue-gray supporting text ■#35505B retains approximately 7.43:1 contrast on the shaded row ■#E9F0F2.
For a selectable white stop card ■#FFFFFF, add a slate-blue border ■#697F88. It contrasts with the white card ■#FFFFFF at approximately 4.21:1 and with the surrounding page background ■#F5F7F8 at approximately 3.91:1. A “View route map” action can be an underlined deep blue ■#235B72 text link, with approximately 6.48:1 contrast on the pale row background ■#E9F0F2.
For the main “Find the next bus” button, use a deep teal fill ■#1B5D69 and white lettering ■#FFFFFF. Text-to-button contrast is approximately 7.46:1, and the button fill contrasts with the page background ■#F5F7F8 at approximately 6.94:1. The filled shape also separates this action from ordinary informational links.
3. Communicate Cancellations and Changes with Words, Not Just Color
For cancellations or timetable changes, one option is a pale cream notice surface ■#FFF3E8 with reddish-brown text ■#94402C. The text-to-notice contrast ratio is approximately 6.35:1. The cream notice ■#FFF3E8 differs from the surrounding page background ■#F5F7F8 by only approximately 1.02:1, so a reddish-brown ■#94402C border may help identify its edges. The border contrasts with the surrounding page background ■#F5F7F8 at approximately 6.45:1.
Do not simply turn a notice red. Include a label such as “Service cancelled” or “Timetable changed,” together with the affected route and date. This is a fictional color example, not actual transit service information.
Before Finalizing, Check Faint Text, Boundaries, and Interaction States
Pale gray ■#B1BDC2 against the page background ■#F5F7F8 has only approximately 1.79:1 contrast, insufficient for normal-sized text. Likewise, a very light line ■#D5DEE2 on a white card ■#FFFFFF provides only approximately 1.37:1, which is too little if that line is required to identify an interactive area. A restrained color scheme still needs legible text and meaningful visible boundaries.
For hover, when a pointer rests over the main button, darken the teal to ■#194E5A; white lettering ■#FFFFFF then has approximately 9.22:1 contrast. For focus, which indicates the current keyboard or similar interaction target, use a slightly offset deep blue outline ■#114B60. It contrasts with the page background ■#F5F7F8 at approximately 8.89:1 and with a shaded timetable row ■#E9F0F2 at approximately 8.28:1.
Under WCAG 2.2 (Web Content Accessibility Guidelines) Level AA, normal-sized text generally requires at least 4.5:1 contrast against its background, while qualifying large text requires at least 3:1. Essential non-text information needed to identify controls or their states requires at least 3:1 against adjacent colors. Color must not be the only visual way of communicating important information. Finally, check the layout on a phone, including horizontally scrolled timetable rows and text that wraps onto additional lines, before settling on the colors.