Skip to main content
wp-config.org

Search tools

Design

Free colour palette generator with dark mode

Find a colour palette for your website in a library of 240, made for this site and sorted by mood and colour, or build one around your brand colour. Every palette comes with a dark mode version, contrast checks for text and buttons, a preview on a sample web page, and code for CSS, Tailwind, SCSS or a WordPress theme.json file.

  • 240 palettes
  • Dark mode versions
  • Contrast checked

Free, no sign-up. It runs in your browser: the colours you pick are not sent to this site.

Nothing you enter leaves your browser.

This tool runs in your browser and needs JavaScript. Turn JavaScript on and reload the page.

Colour palette generator

What you can do

  • Browse 240 palettes by mood, colour or name

  • Find palettes with a colour close to yours

  • See a dark mode version of every palette

  • Check text and button contrast against WCAG 2.2

  • Preview the palette on a sample web page

  • Copy it as CSS, Tailwind, SCSS or theme.json

How to choose a colour palette

  1. Find a palette you like

    Narrow the library by mood, such as calm or corporate, and by colour (choose several to see palettes with any of them), search by name, or enter your brand colour to see palettes with a colour close to it. To start from your own colour instead, open the From your brand colour tab.

  2. Check it in light and dark

    Press a palette to see its colours with their jobs, a sample web page in its light and dark versions, and whether text and buttons pass the WCAG 2.2 contrast checks.

  3. Copy the code

    Choose CSS custom properties, Tailwind CSS, SCSS or a WordPress theme.json palette and copy the code, or copy a link to the palette to share it.

How the palettes work

A palette for a website is more than a row of nice colours: each colour has a job. This tool gives every colour one, by a fixed rule, so the preview and the checks show how the palette behaves on a real page.

  • Background: the lightest colour.
  • Text: the darkest colour.
  • Primary: the most colourful of the rest, for buttons and links.
  • Accent: the next most colourful, for badges and highlights.
  • Surface: one more colour, for cards and panels. When a palette has none left, the surface is the background mixed 6% toward the text.

Where the palettes come from

Every palette in the library was made for wp-config.org. A script generated candidates from colour harmonies in the OKLCH colour space, varied within each mood (four to six colours, plain or tinted backgrounds, one or two accents); they were then looked over side by side, and 240 of them chosen, named and given their moods by hand. The colour tags, such as blue or warm, are measured from the colours themselves. None is copied from another palette site. OKLCH describes a colour by its lightness, chroma (how colourful it is) and hue, in a way that matches what the eye sees more closely than HSL, so a palette built in it keeps an even feel across hues. It is part of CSS Color 4 and works in every current browser.

The dark mode versions

Turning a palette upside down rarely gives a good dark mode, so each dark version is worked out colour by colour. The background becomes a very dark shade with a hint of the light background’s hue, the surface a step lighter, and the text a near-white. The primary and accent colours keep their hue and colourfulness and only get lighter, in small steps, until the primary colour stands out at 3:1 against the dark background and a button in it can carry text at 4.5:1. Every dark version in the library passes all four checks.

The contrast checks

The checks use the WCAG 2.2 contrast ratio, the same maths as the colour contrast checker: text on the background and on the surface need 4.5:1, the primary colour needs 3:1 against the background, like an icon or a button’s edge, and the text on a primary button needs 4.5:1. The light versions are shown exactly as made, so a pastel palette can fail the primary colour check: such colours work for fills and decoration, not for text.

In WordPress

Copy the theme.json palette into your block theme’s theme.json file (version 3, for WordPress 6.6 and later) and the colours appear in the editor’s colour pickers, with custom properties such as --wp--preset--color--primary. The dark style copies as a style variation: save it as styles/dark.json in the theme and choose it under Appearance › Editor › Styles. The Theme Handbook explains the colour settings. A classic theme usually keeps its colours in the Customizer or in style.css, where the CSS custom properties fit.

Frequently asked questions

How many colours should a website palette have?

Four to six is plenty for most sites: a background, a text colour, a primary colour for buttons and links, an accent, and a surface for cards. The palettes here have four to six colours for that reason. More colours make a site harder to keep consistent, and each extra one needs its own contrast checks.

How do I pick colours for my website?

Start from a colour you already have, such as your logo’s, and build around it with the From your brand colour tab, or browse the library by the mood you want. Then check the result: text needs a contrast of at least 4.5:1 on its background to be easy to read, which the checks under each preview show.

What is the difference between the five harmonies?

They are classic ways of choosing colours around a colour wheel. Complementary adds the opposite hue, for strong contrast. Analogous adds the neighbours on either side, for a calm look. Triadic uses three hues evenly spaced. Split complementary uses the two hues beside the opposite one. Monochrome uses lighter and darker shades of your colour alone.

Why do some light palettes fail a check?

Light versions are shown as they were made, so you can see their real limits. Pale colours, as in the pastel palettes, cannot stand out at 3:1 on a near-white background, so they suit fills, backgrounds and illustrations rather than text or buttons. The text checks pass in every library palette, and every dark version passes all four checks.

Can I use these palettes on my own site, including for clients?

Yes. The palettes were made for this site from colour theory, not copied from anyone, and you are free to use them in any project, including client work, without credit. A link back is welcome but not needed.

How do I add a palette to a WordPress block theme?

Choose theme.json palette, copy the code and merge its settings.color.palette into your theme’s theme.json file. For dark mode, copy the theme.json dark style and save it as styles/dark.json in the theme; it then shows as a style under Appearance › Editor › Styles. If you edit a theme you did not make, make a child theme first, so an update does not undo your changes.

Is anything I enter sent to this site?

No. The palettes and checks are worked out in your browser and the colours you pick are not sent to this site. The palette you are looking at is added to this page’s address so you can copy a link to it, which means the address reaches the site like any page request when the page is reloaded or the link is opened. The site counts that the tool was used, never which colours. The privacy policy has the details.

Related tools

  • Colour contrast checker

    New (added recently)

    Check the contrast of text and background colours against WCAG 2.2 AA and AAA, with suggested passing colours and a palette checker.

  • Favicon generator

    New (added recently)

    Make favicon.ico, Apple and Android icons and a web app manifest from your logo or a letter, in your browser.

  • Web font previewer

    New (added recently)

    Preview 60 popular web fonts in every weight, see heading and body pairings, and copy the code for Bunny Fonts, Google Fonts or WordPress.

  • Create a WordPress child theme with style.css, functions.php and a ZIP download.