Skip to main content

Website Colour and Branding Guide: Palettes, Contrast Ratios and Consistency

In this article

Choosing website colours well comes down to four decisions. Pick a small palette: one neutral base, one brand colour and one accent reserved for actions. Check every pairing of text and background against the contrast ratios in WCAG 2.2 level AA, which means at least 4.5:1 for body text. Write the colours into the code as named values so nobody picks a "close enough" shade later. Then use the same values on the site, in print and on social media.

Most of what is written about colour on websites is about psychology: blue means trust, red means urgency. Conventions exist and are worth knowing. But they will not rescue a site where the text is unreadable on a phone in daylight or the buttons look different on every page. This guide is about the practical side: palettes, ratios, code and consistency.

Start from the brand you already have

If you have a logo, a van, signage or printed stationery, the palette already exists and the job is to find its exact values. Ask whoever made the logo for the hex codes, or sample them from the original file rather than from a photo. If the brand colour is too light to work as text (many are), keep it for large areas and headings. Derive a darker shade of the same hue for text and links. Do not invent a second brand colour to fix the problem.

If you are starting from nothing, pick one colour you can live with for ten years and build everything else around neutrals.

Build the palette: base, brand, accent

The 60-30-10 rule from interior design works well for a website. Roughly six parts neutral base, three parts brand colour, one part accent. The accent is the colour of action: buttons, links, the thing you want pressed. Because it appears nowhere else, the eye goes to it.

RoleWhere it is usedExampleContrast on white
BasePage background, cards, panels#FFFFFF or #F5F7FAn/a
Body textParagraphs, lists, tables#1F2933 (very dark grey)14.8:1
Muted textCaptions, dates, help text#52606D6.5:1
BrandHeadings, navigation, section bands#1B3A5C (navy)11.6:1
AccentButtons and links only#C2410C (burnt orange)5.2:1 as text; 5.2:1 for white text on it
FeedbackSuccess, warning, error messagesGreen, amber, red, each paired with an icon and wordsCheck each one

The example values are a working palette, not a recommendation for your brand. The point of the table is the right-hand column: every colour that will ever carry text has a ratio against the background it sits on. That ratio is checked before the colour is approved. A very dark grey reads more comfortably than pure black for long text, and still has contrast to spare.

From the brand colour, derive one scale of five to seven tints and shades for hover states, borders and backgrounds. One scale keeps everything in the same hue; a second brand colour is where palettes start to drift.

Contrast ratios under WCAG 2.2 AA

The Web Content Accessibility Guidelines set contrast as a ratio between the lightness of the text and the lightness of what is behind it. The scale runs from 1:1 (identical) to 21:1 (black on white). Level AA is the standard most UK organisations work to, and the one referenced by the public sector accessibility regulations.

WhatMinimum ratio at AANotes
Body text4.5:1Anything smaller than large text, including links, labels and table cells
Large text3:1At least 24px regular, or about 19px bold
Interface components and graphics3:1Button edges, form field outlines, icons that carry meaning, chart lines
Focus indicatorVisible, and not hiddenKeyboard focus must be visible and, under WCAG 2.2, not covered by sticky headers or cookie bars
Logos and decorative textExemptA logo may fail; the navigation and buttons next to it may not

How to check a pairing

The colour picker in Chrome's developer tools shows the contrast ratio of any text against its background and marks the AA and AAA lines. WebAIM's contrast checker does the same for two hex values. Check the real pairings on the real page: a muted grey that passes on white may fail on a tinted panel.

The pairings that usually fail

  • Light grey text on white. #9AA5B1 on white is 2.5:1. It looks refined in a mock-up and vanishes on a phone outdoors. #767676 on white is 4.5:1, which is the lightest neutral that passes.
  • White text on a light brand colour. White on a sky blue such as #60A5FA is 2.5:1. Darken the button or use dark text on it.
  • Dark text on a saturated accent. #1F2933 on the orange above is 2.9:1. One accent colour usually works with white text or with dark text, not both.
  • Text over photographs. The ratio changes with the image. Put a solid or near-solid panel behind the text or do not put text there.
  • Placeholder text inside form fields. It is text, so it needs 4.5:1, and most default placeholders fail. Use a label above the field instead.

Colour must never carry meaning alone

Some visitors cannot tell red from green, and everyone struggles to on a cheap screen. WCAG asks that colour is never the only way information is given. In practice:

  • Error messages get an icon and a sentence, not just a red outline.
  • Links in body text are underlined, or distinguished from the surrounding text in a way that does not depend on hue.
  • Required fields are marked with words, not only a coloured asterisk.
  • Status badges (paid, pending, overdue) carry the word as well as the colour.
  • Charts use labels or patterns as well as colour, and the key is readable in greyscale.

These are also among the website design mistakes small businesses make most often, because a designer checking their own work on a good monitor never sees the problem.

Writing the colours into the code

A palette only stays consistent if there is one place it lives. In CSS that is a set of custom properties declared once and used everywhere; no component carries a hex value of its own. The same block handles dark mode by swapping the values when the visitor's system asks for it.

:root {
  --colour-bg: #FFFFFF;
  --colour-text: #1F2933;
  --colour-muted: #52606D;
  --colour-brand: #1B3A5C;
  --colour-accent: #C2410C;
  --colour-accent-text: #FFFFFF;
}

@media (prefers-color-scheme: dark) {
  :root {
    --colour-bg: #121417;
    --colour-text: #E6E9EC;
    --colour-muted: #A3ACB5;
    --colour-brand: #8FB3DB;
    --colour-accent: #F0906A;
    --colour-accent-text: #1A1A1A;
  }
}

.button-primary {
  background: var(--colour-accent);
  color: var(--colour-accent-text);
}

Three things to notice. The dark values are not the light values inverted. A lighter, less saturated version of the brand and accent colours is chosen so that each pairing still passes (every dark-mode pairing above is over 7:1). The accent's text colour switches from white to dark because the lighter accent no longer carries white text. And the logo needs thought: an SVG that uses the current text colour, or a second version for dark backgrounds, so it does not disappear.

Keeping it consistent across site, print and social

Drift happens when different people pick colours in different places: a designer in a layout tool, a marketing assistant in a social template, a printer matching by eye. The cure is a one-page brand sheet listing each colour with its hex value for screens and its CMYK or Pantone reference from your printer. It also lists the rule for each (where it is used, what text goes on it). Everyone works from the sheet.

On the website, the same discipline means editors are not given a colour picker. On the business websites we build, the admin area lets a client change prices, opening hours, photos and news. But the palette is in the stylesheet, and that is deliberate. A button that is a slightly different orange on one page tells a visitor something is off even when they cannot say what. Our guide to building SEO and UX into the code covers the other decisions that belong in the template rather than in the editor's hands.

Photographs are part of the palette too. A consistent treatment (same warmth, same crop style, no filters one week and heavy filters the next) does more for a brand than any colour choice. That is why real photography is among the 2026 design trends worth following.

Questions people ask

What contrast ratio do I need for website text?

At WCAG 2.2 level AA, 4.5:1 for ordinary text and 3:1 for large text (24px regular or about 19px bold and above). Interface elements such as button borders and form outlines also need 3:1 against their surroundings. Level AAA raises body text to 7:1.

The Equality Act 2010 requires service providers to make reasonable adjustments for disabled people, and that duty applies to websites. Public sector bodies have specific regulations that reference WCAG level AA. For a private business there is no fixed standard written into law, but WCAG 2.2 AA is what a court or a complaint would measure against. Contrast is the easiest part of it to get right.

How many colours should a website have?

One neutral base with a text colour and a muted text colour, and one brand colour with a scale of tints and shades. Plus one accent for actions and a small set of feedback colours. That is three hues plus neutrals. More than that and the accent stops standing out, which is the whole reason it exists.

Should my website have a dark mode?

Only if you will test it properly. A dark palette that is simply the light one inverted usually fails contrast on the accent colour and loses the logo. If the site is mostly read on phones in the evening (a venue, a takeaway, a late-night booking page) it is worth doing well. For most business sites a single well-built light palette is the better use of the budget.

A palette check you can do this afternoon

Open your home page and your contact page on a phone, outside, with the brightness where it normally sits. Then open the developer tools on a computer and check four pairings: body text on the page background, muted text on the same, and white text on your main button. The fourth is link text against the paragraph around it. Write down each ratio. Anything under 4.5:1 is a change to make this week, and it is usually one line in the stylesheet.

While you are there, note every place the accent colour appears that is not a button or a link. Each one is a small reason the real buttons get pressed less. The mobile-first design checklist has the rest of the small-screen checks that go with this one.