You have a screenshot of a competitor's site, a photo of a printed brochure, or a PDF a client exported six months ago, and you need the exact color of one element. Picking a pixel takes a second. Picking the right pixel is where people go wrong, and the failure is quiet — you end up with a color that is close enough to look correct in isolation and visibly wrong when placed next to the real thing.
This post is about the specific ways screenshots lie, and how to work around each one.
Anti-aliasing: never sample near an edge
This is the mistake that catches everyone. To make edges look smooth, renderers blend boundary pixels between the shape and its background. A blue button on a white page does not go straight from white to blue — there is a band one to three pixels wide of intermediate colors that belong to neither.
Sample inside that band and you get a color that exists nowhere in the design. On a dark background the reading skews dark; on a light one it skews light. Either way it is wrong by a few percent in a direction that is hard to spot.
The rule is simple: sample from the middle of a large flat area, never within a few pixels of any boundary. The center of a button, not its rounded corner. The middle of a header bar, not where it meets the content.
Text is the worst case. Rendered glyphs are almost entirely anti-aliased edge, especially at body sizes, so even the darkest pixel in a letterform is usually lighter than the actual specified color. If you need a text color, find somewhere the same color appears as a fill — a solid badge, an icon, a rule — or accept that you are estimating. A 24x magnifier such as the one in our color detector makes the anti-aliased fringe visible before you click, which is exactly why the loupe is there.
JPEG compression scatters color
JPEG achieves its file sizes partly by throwing away color detail. It converts to a brightness-plus-color representation, then stores the color channels at lower resolution than the brightness channel, because human vision notices brightness detail far more.
The practical result: in a JPEG, a flat area is not flat. Sample three neighbouring pixels in what should be one solid color and you may get three slightly different values. Around high-contrast edges you also get ringing — faint halos of shifted color that are pure compression artifact.
Two defences. Prefer PNG whenever you can get one; screenshot tools mostly produce PNG by default, which is lossless and therefore trustworthy. Where you only have a JPEG, sample several points across the flat region and look for the value that repeats, rather than trusting a single click. Heavily compressed images may simply not contain a reliable answer, and it is better to know that than to ship a guess.
Gradients and subtle overlays
Plenty of surfaces that read as flat are not. A "solid" header may carry a gradient of a few percent. Cards often sit under a barely-visible overlay. Buttons frequently have an inner shadow at the top or bottom that shifts the color slightly across their height.
If two samples from opposite ends of the same element disagree, you are on a gradient, and there is no single correct answer. Decide which value you actually want — the top stop, the bottom stop, or the midpoint — and sample deliberately. Our color mixer is useful in reverse here: enter the two ends and read the midpoint rather than trying to click it precisely.
Transparency has no color of its own
A semi-transparent element does not have a color in the screenshot — it has a composite. A white card at 90% opacity over a photograph produces a different pixel value at every point, and none of those values is the card's color.
You can recover it if you can find the same element over two known backgrounds, but in practice this is rarely worth it. The more useful move is to recognise the situation and stop trying. Ask for the source value, or reconstruct the effect rather than the pixel: if it is a frosted panel, rebuild it with a glassmorphism style and tune it until it matches by eye. What you are copying is the treatment, not one number.
Color profiles: the invisible shift
This one is genuinely hard to detect. Images can carry an embedded color profile — sRGB, Display P3, Adobe RGB — that tells software how to interpret the stored numbers. A screenshot taken on a wide-gamut display may be tagged Display P3, and the same numeric values mean a more saturated color there than they do in sRGB.
When such an image is loaded into a canvas, the browser may convert the data to sRGB. You then get accurate sRGB numbers for how the color appears — which is usually what you want for web work — but not the numbers that were in the original file.
The signal to watch for: a color that reads as noticeably more vivid on screen than the HEX you extracted suggests it should be. If brand accuracy genuinely matters, ask for the specification rather than reverse-engineering it. Every brand has the value written down somewhere.
Screenshots of print are a different problem
A photograph of a printed brochure records the color of ink under whatever light happened to be in the room, filtered through a camera's white balance. Move to a window and the same brochure photographs differently. Print also uses CMYK, whose gamut does not map cleanly onto a screen's.
You can get a usable approximation this way, but treat it as a starting point for conversation, never as a specification. Photograph under neutral daylight if you can, include a plain white sheet in frame as a reference, and expect to adjust. Our color models guide explains why CMYK and RGB do not translate cleanly in either direction.
A workflow that produces a trustworthy value
- Get the best source available. PNG over JPEG. Full resolution over a resized copy. A direct screenshot over a photo of a screen.
- Zoom before you click. Use the magnifier to see the pixels you are about to sample, and confirm you are on flat area rather than a fringe.
- Sample three times. Three points across the same flat region. Agreement means confidence; disagreement means gradient, compression or transparency, and tells you which problem you have.
- Sanity-check the value. Convert to HSL and look at the numbers. Deliberate brand colors tend to land on tidy-ish values; a reading of
hsl(217 89% 59%)when the brand is plausiblyhsl(217 91% 60%)is a hint you caught an artifact rather than the real thing. - Check the dominant palette. If a color appears in the detector's automatically-extracted dominant colors, it covers a meaningful area of the image and is more likely to be a real design decision than a compression artifact.
When to stop and just ask
Reverse-engineering a color is the right approach for reference, inspiration and matching something you cannot obtain. It is the wrong approach when accuracy is contractual — reproducing a client's brand, matching a partner's identity, anything going to print.
In those cases the value exists in a brand guideline, a style guide, or a designer's file, and an email is faster and more reliable than any amount of careful pixel-picking. Sampling gets you extremely close. For brand-critical work, extremely close is still wrong.
Once you have a color you trust, the rest of the toolkit takes over: build a full scale with the Tailwind generator, produce lighter and darker variants with the tint and shade generators, and confirm the pairings you plan to ship in the contrast checker.