Home / Blog / Get a website's color palette

How to Get Any Website's Color Palette

Published August 11, 2026 · Updated August 11, 2026 · 6 min read · by the CSS DNA team

Quick answer: Read the page's computed styles, not a screenshot. Screenshot-based extractors sample pixels, so they hand you photo colors, antialiasing blends and averaged gradient midpoints — values that appear nowhere in the stylesheet. Walking every rendered element instead gives you the actual declared colors, ranked by how many elements use each one.

Two completely different methods, sold as the same thing

Every palette tool falls into one of two camps, and the difference determines whether the output is usable.

Screenshot samplingComputed styles
How it worksRenders the page to an image, clusters pixel colorsWalks the DOM, reads each element's resolved color values
Returns real hex codes?No — cluster centroidsYes — the declared values
Includes photos and logosYes, unavoidablyNo
Below-the-fold colorsOnly if it captures full pageYes, whole document
Border and outline colorsLost to antialiasingCaptured exactly
Usage frequencyPixel areaElement count

Pixel area and element count are not the same signal, and the difference is not academic. A hero image occupies half the screen and produces a dominant “brand color” that is really a photograph. Meanwhile the actual brand accent — used on twelve buttons totalling maybe 4,000 pixels — ranks near the bottom or gets clustered away entirely.

The four things screenshot extractors reliably get wrong

  • Antialiasing blends. The edge of every glyph is a gradient between text color and background. Cluster those and you get grays nobody chose.
  • Gradient midpoints. A two-stop gradient produces hundreds of intermediate pixel values; sampling returns the middle, which is not either stop.
  • Overlays and transparency. A rgba(0,0,0,.4) scrim over an image samples as a darkened photo color, not as the scrim.
  • Everything behind a state. Hover, focus and active colors never render in a screenshot, so they never appear in the palette.

The method that works

  1. Install CSS DNA — free, no account.
  2. Open the page and click Extract. It walks every rendered element and collects color, background-color, border-color, gradient stops and any CSS custom properties holding colors.
  3. Read the palette panel. Swatches are ranked by element count, so the top of the list is the site's real structure: background, surface, body text, then the accent.
  4. Toggle the format to hex, RGB, HSL or OKLCH and click any swatch to copy it — or to generate its full 50–950 tonal scale.

For a single color rather than the whole page, the eyedropper picks any pixel on screen and reports it with its contrast against what sits behind it. Both the palette and the eyedropper are free; the token exports are the Pro feature.

Now delete half of it

An extracted palette from a real production site is usually too long. Not because the site uses forty colors deliberately — because forty colors accumulated. Two teams each picked a border gray. A component library shipped its own neutrals. A dark-mode pass rounded some values and not others.

#1a1a1a · 84 elements
#1b1a1c · 6 elements

These two are indistinguishable side by side, let alone across a page. Keeping both means two tokens, two names, and a future decision about which one a new component should use. It is drift, not design.

Catching these by eye does not work — the whole problem is that they look identical. It needs a perceptual distance measure. CSS DNA compares every extracted pair using ΔE in OKLab and flags any pair closer than 0.03, which is roughly the threshold below which two colors stop being separable in normal use. Merge each flagged pair into whichever value has the higher element count, and a forty-swatch dump usually collapses to eight or nine real decisions.

Evidence and sources

Claim
Perceptual color difference should be measured in a perceptually uniform space such as OKLab, where Euclidean distance approximates perceived difference — not in sRGB, where it does not.
Basis
OKLab was designed so that numeric distance corresponds to perceived difference; CSS Color 4 specifies it, and color-mix() and gradient interpolation in oklab rely on the same property.
Source
Björn Ottosson — A perceptual color space for image processing · W3C CSS Color 4
Method
CSS DNA computes ΔE as the Euclidean distance between OKLab coordinates and reports pairs below 0.03 as near-duplicates. The threshold is a practical default, not a standard.
Verified
August 11, 2026.
Limitations
A single scan captures one page in one theme at one viewport. Run it again in dark mode and on a second template before treating the result as the whole system.

From palette to system

A list of hex codes is not a design system. Three steps turn it into one:

  1. Assign roles, not hue names. --surface, --surface-raised, --text, --text-muted, --accent, --border. Naming a token --blue guarantees a rename the first time the brand shifts.
  2. Generate ramps. Each surviving color becomes a 50–950 scale built in OKLCH, so you have the steps you need for hover, disabled and dark mode instead of inventing them later.
  3. Check the pairs that will actually meet. A palette-vs-palette contrast grid shows every foreground and background combination at once, in both WCAG 2 ratios and APCA Lc — which is where you find out the muted text you liked fails on the raised surface.

From there, export it: Tailwind v3 config or v4 @theme, CSS custom properties, SCSS, JSON, or W3C design tokens for Figma.

Can you use another site's colors?

Individual color values are not copyrightable, and a hex code is a number. Reproducing a competitor's palette together with their logo colors, type and layout is a different question — that territory is trade dress. Treat extracted palettes the way you would treat any reference: a starting point to study and adapt, not a design to clone. This is general information, not legal advice.

Frequently asked questions

How do I get a website's color palette?

Read the page's computed styles rather than sampling a screenshot. An extension that walks every rendered element collects each declared color with the count of elements using it, which gives you a palette ranked by real usage.

Why do screenshot color extractors give wrong results?

They sample pixels, so they return photo and logo colors, antialiasing blends along text edges, and averaged gradient midpoints. None of those are values in the stylesheet, and colors below the fold or behind a hover state never appear.

How many colors should a website's palette have?

A deliberate design usually resolves to five to nine base colors plus their tonal ramps. If extraction returns forty, most are unintentional near-duplicates from different components rather than real design decisions.

What are near-duplicate colors and why do they matter?

Near-duplicates are colors too close to tell apart, such as #1a1a1a and #1b1a1c. They add tokens without adding meaning, and they signal drift where two teams picked a gray independently. CSS DNA flags pairs under a perceptual distance threshold.

How do I turn an extracted palette into design tokens?

Assign each color a role rather than a name based on its hue, merge the near-duplicates, generate a 50 to 950 ramp for each survivor, then export as Tailwind theme values, CSS custom properties, SCSS, JSON or W3C design tokens.

Pull any site's real palette

Ranked by usage, converted to OKLCH, with near-duplicates flagged. Free to inspect — nothing leaves your browser.

Add CSS DNA to Chrome — Free