WordPress Color Palette & Contrast Studio

Give your website a coherent color system. Edit a palette, check text and UI contrast, try the colors in a live layout, then export WordPress theme.json or CSS variables.

Build your color system

Edit colors, check a pair, then take the palette into your theme.

On your device

Your palette

7 / 24 colors

Opaque sRGB HEX only. Names can change; export slugs stay fixed. Assign each preview role once.

Changes are saved in this browser. Reset restores Coastal blue.

See it in a real layout

Interactive sample
Studio / Journal

A place for your next idea

Good design starts with a clear palette.

Give every color a purpose. Keep the reading comfortable, and let the important actions stand out.

A small idea, made useful.

A card with surface, text and muted roles.

Note

Accent marks this notice. Check its contrast against the surface.

Use the sample controls to explore your colors.

Button text uses Background. Missing preview roles use Coastal blue defaults; exports contain your palette only.

Check a color pair

17.06:1
Aa — Read the difference.Body text, labels and everyday details.
  • Normal text · AAAt least 4.5:1Pass
  • Normal text · AAAAt least 7:1Pass
  • Large text · AAAt least 3:1Pass
  • Large text · AAAAt least 4.5:1Pass
  • UI / meaningful graphics · AAAt least 3:1Pass

Text on Background: 17.06:1. Normal text AA passes.

Large text: at least 24 CSS px regular or about 18.67 px bold. UI checks apply to meaningful boundaries and graphics against adjacent colors; there is no separate AAA UI threshold. Ratios display rounded down; checks use full precision.

Use your palette

theme.json v3 · WordPress 6.6+. Merge settings.color.palette into your existing file; keep its other settings and styles.

{
  "$schema": "https://schemas.wp.org/wp/6.6/theme.json",
  "version": 3,
  "settings": {
    "color": {
      "palette": [
        {
          "name": "Primary",
          "slug": "primary",
          "color": "#1D4ED8"
        },
        {
          "name": "Secondary",
          "slug": "secondary",
          "color": "#0F766E"
        },
        {
          "name": "Accent",
          "slug": "accent",
          "color": "#B45309"
        },
        {
          "name": "Background",
          "slug": "background",
          "color": "#F8FAFC"
        },
        {
          "name": "Surface",
          "slug": "surface",
          "color": "#FFFFFF"
        },
        {
          "name": "Text",
          "slug": "text",
          "color": "#0F172A"
        },
        {
          "name": "Muted",
          "slug": "muted",
          "color": "#475569"
        }
      ]
    }
  }
}

Ready to copy or download.

Complete the system with WordPress Spacing System Generator, or merge your colors with other settings in the WordPress theme.json Generator.

How to build a WordPress color palette

  1. Start from Coastal blue, Evergreen & cream, Ink & violet or Editorial plum.
  2. Rename colors and enter HEX values, or use the color pickers. Add up to 24 colors; keep at least two.
  3. Assign Primary, Secondary, Accent, Background, Surface, Text and Muted roles to see the colors in the sample interface. Assigning a role moves it from its previous color.
  4. Select a foreground and background pair. Check the exact text size and UI use you intend to ship.
  5. Copy or download the palette as theme.json or CSS variables. Reset returns to Coastal blue.

This is useful for block-theme starters, client brand systems and checking a redesign before editing templates. The preview includes navigation, buttons, a card, a notice and a text field. Its controls work locally, so you can inspect states while you design.

Read the contrast results in context

The checker converts opaque sRGB colors to relative luminance, then divides the lighter luminance plus 0.05 by the darker luminance plus 0.05. Ratios range from 1:1 to 21:1. It uses the full ratio for decisions and rounds the displayed number down to avoid showing a failing pair as a pass.

WCAG AA requires 4.5:1 for normal text and 3:1 for large text. AAA raises those thresholds to 7:1 and 4.5:1 respectively. Large text means at least 18 pt (24 CSS px), or 14 pt (about 18.67 CSS px) when bold. See W3C’s minimum contrast guidance and enhanced contrast guidance.

The 3:1 AA check for non-text contrast concerns visual information needed to identify controls, states and meaningful graphics against adjacent colors. A button’s label still needs its own text check. These pair results do not certify a whole site: keyboard access, focus, semantics, text size, images and other requirements need separate review.

A practical example: a blue call to action

White #FFFFFF on Coastal blue’s Primary #1D4ED8 has a contrast ratio of 6.70:1. It passes normal-text AA. Choose Surface as foreground and Primary as background to inspect that pair; then check Primary against Background for its surrounding boundary. Test muted text on both Background and Surface as a separate step.

Add your colors to theme.json

The export follows WordPress theme.json version 3, supported from WordPress 6.6. It pins the 6.6 schema because these palette fields need no newer features. Each entry under settings.color.palette contains a human-readable name, a stable slug and an opaque HEX color.

In your existing theme.json, merge the palette array into settings.color. Preserve other settings, styles and metadata, and check for slug collisions with colors already used by your theme. Keep the version-specific schema appropriate for your theme. Back up the file and test in a child theme or development site before changing the live theme.

/* WordPress creates this variable from the primary slug. */
.call-to-action {
  background: var(--wp--preset--color--primary);
}

Color presets become available to supported editor color controls; this palette export does not assign global or block styles. Set those separately in the WordPress theme.json Generator. Preview roles belong to this tool and do not automatically style WordPress buttons or blocks.

Use CSS variables on any website

Choose CSS variables to generate a :root block with properties such as --color-primary and --color-background. Paste it into your stylesheet and use var(--color-primary) where you need it. This export works independently of WordPress.

The default seven colors have stable role-based slugs. Added colors get a unique slug such as color-8. Renaming a color or changing its preview role keeps its slug stable, so references do not silently change.

Frequently asked questions

Can I use transparent colors or gradients?

This tool accepts opaque three- or six-digit sRGB HEX colors only. Alpha, gradients and wide-gamut values need additional compositing and are not accepted. Check the actual background behind text when using those elsewhere.

Will Site Editor changes override my palette?

WordPress combines defaults, theme settings and user customizations. Existing Site Editor choices can take priority over theme styles, and individual blocks may have their own colors. Test the result in the editor and on the front end instead of assuming a file change restyles every block.

What happens to my colors when I close the page?

The most recent valid palette is saved in local storage in this browser, independently of analytics consent. It is not synced between devices. Reset replaces it with Coastal blue. Clear this site’s browser data to remove it entirely. If storage is blocked, the tool still works and tells you to export before leaving.

Why can a passing color pair still be difficult to read?

The ratio measures a pair of solid colors. Small or thin fonts, image backgrounds, overlays and surrounding content can change practical readability. Check real components in their actual states and context as well.