Free tool

Colour Palette Generator

Press Space, lock the colours you like and check WCAG contrast. Download the finished palette as an .md file with HEX codes, CSS variables and contrast ratios, ready to paste into an AI assistant when you build a site.

5

Click the palette (or Tab to it) and press Space to generate new colours; outside the palette, Space scrolls the page as usual. Click a HEX code to type your own colour. The lock keeps a column fixed. Arrow keys move focus between columns. Change the page background with the small control in the bottom-left corner.

Your settings are remembered only in this browser (they are not sent anywhere).

WCAG contrast

Pick a text and background colour from the palette (or white/black) to see a preview and the result at levels AA and AAA.

—

    Heading preview

    This is how regular paragraph text looks on the chosen background. Check whether you can read it without effort.

    Small helper text (13 px).

    Contrast of each colour against white and black
    Colourvs. whitevs. blackBetter text

    Export palette

    Download the .md file as context for AI, or copy the palette as CSS, JSON or a Tailwind config.

    How to use the colour palette generator

    1. Click the palette and press Space, or use "Generate colours", until you land on colours you like.
    2. Lock the columns you want to keep with the padlock. Further shuffles change only the unlocked colours and match them to the locked ones.
    3. Choose a harmony and the number of colours (2 to 8).
    4. Adjust any colour by typing its HEX code (for example #2A9D8F or the short form #2a9).
    5. Check the text and background contrast, then download the .md file or copy the palette link. The page URL contains the colours, for example #264653-2a9d8f-e9c46a.

    An .md file as context for AI

    AI assistants that build websites and apps stick best to concrete values. The .md file from this colour palette generator puts everything in one place: a colour table (HEX, RGB, HSL, name), contrast against white and black, :root CSS variables, optional Tailwind tokens, text/background pairs that meet WCAG AA, and a few short guidelines. Paste it into a chat with your AI, or add it to your project repository (for example as design/palette.md), and ask it to use only these colours.

    Colour harmonies

    • Analogous: neighboring hues on the colour wheel, a calm and consistent look.
    • Complementary: opposite hues (180°), strong contrast, good for accents.
    • Triad: three hues 120° apart, a lively but balanced palette.
    • Tetrad (rectangle): four hues 90° apart, rich, needs careful balancing of proportions.
    • Split complementary: a base hue plus the two neighbors of its complement; softer contrast than plain complementary.
    • Monochromatic: one hue in different lightness and saturation levels.

    WCAG contrast in brief

    The WCAG (Web Content Accessibility Guidelines) set a minimum luminance ratio between text and background. The result is a number from 1:1 (no contrast) to 21:1 (black on white).

    • AA: 4.5:1 for regular text, 3:1 for large text (24 px or larger, or 18.66 px bold) and interface elements.
    • AAA: 7:1 for regular text, 4.5:1 for large text.

    A colour that looks great as a swatch can be unreadable as text, so the generator shows the ratio for each pair and suggests whether white or black text works better on a given colour. Calculations follow the WCAG 2.x formula based on relative luminance.

    Frequently asked questions

    How do I generate a colour palette?

    Click the palette and press Space (outside the palette, Space scrolls the page), or use the "Generate colours" button. Each use shuffles a new set. Lock the columns you like with the padlock icon and keep shuffling the rest. You can also type a HEX code by hand in the field under a colour.

    Is the palette generator free, and does it store my data?

    Yes, it is free and needs no sign-up. All calculations happen in your browser. The tool does not send palettes to a server. Visit statistics are collected only with your consent; see the Privacy policy and “Privacy settings” in the footer. The palette is stored in the page address (after the # sign), so you can share it as a link. Your last palette, harmony and background are remembered only in your browser (localStorage) and are never sent to a server; the "Clear saved settings" button removes them.

    What does the palette .md file contain, and what is it for?

    The Markdown file lists, for each colour, its HEX, RGB and HSL code, a descriptive name, the contrast against white and black, and which text colour is readable on it. It also includes ready-made :root CSS variables, an optional Tailwind configuration and text/background pairs that meet WCAG AA. You can paste it into an AI assistant as context when building a site, so it uses only your colours.

    What colour contrast does WCAG require?

    Level AA requires a contrast ratio of at least 4.5:1 for regular text and 3:1 for large text and interface elements such as input borders and icons. Level AAA requires 7:1 for regular text and 4.5:1 for large text. The "WCAG contrast" section under the palette calculates these values for the pair of colours you choose.

    What is the difference between colour harmonies: analogous, complementary, triad?

    A harmony describes how hues relate on the colour wheel. Analogous uses neighboring hues and looks calm. Complementary pairs opposite hues and gives strong contrast. Triad and tetrad space hues evenly, 120° or 90° apart. Monochromatic is a single hue in different lightness levels. If you lock one colour, the generator builds the others around its hue.

    How does locking a gray colour work?

    A gray (with very low saturation) has no distinct hue, so it cannot be the base of a harmony. If only grays are locked, the generator picks a random base hue and builds the other colours around it; the gray stays unchanged.

    Need a website or online store in these colours?

    I'm Paweł Zieliński. I build fast WordPress sites, WooCommerce stores and automations. Get in touch or see the services and pricing. You'll find more free tools in the tools directory.

    Background