HIYSL REFERENCE / FIELD NOTES

How to Pick and Match a Color From an Image or Screenshot

Contents
AI-generated illustration; not taken on location · Illustration of a color sample moving from an image to a matching swatch
AI-generated illustration; not taken on location · A color sample provides a starting point for a match.AI-generated illustration

To match a color from an image or screenshot, open it in a tool that can sample image pixels, select a representative point, and copy the resulting color value into the application where you need it. Start with a point inside the area you want to match, then compare nearby pixels before settling on a value.

A sampled color is a useful starting point, but the best pixel depends on your goal. Matching a flat button fill calls for a different point than matching its shadow, and a photograph may offer several plausible choices. Check the result in its final setting before building the rest of your design around it.

Prepare a useful image

Begin with the original image when you have it. If you are capturing an interface, make a clean screenshot that includes the entire area you want to match. A PNG screenshot usually preserves flat interface colors more reliably than a compressed JPEG, making it a useful choice when you can select the format.

Try to capture the color itself rather than a photograph of a screen. If the only available source is a photograph, you can still sample it, but treat the result as a match to that photograph. Lighting, white balance and editing filters can affect the recorded color of a photographed object.

Find a way to sample the image

Open the image in a color picker or image-editing application that lets you select a point in an image and read its color value. Look for an image-opening option and a sampling or eyedropper control; their names and locations depend on the application. Check that the displayed value changes when you select different points.

If the picker you have cannot open the image or screenshot, use another application that can both display the image and sample a pixel. Copy the resulting value into the application where you need it, or into a separate color tool if you want to work with it further. You do not need to assume that every tool called a color picker accepts image uploads.

Keep the source handy while you work. If the first sample looks wrong after you apply it, being able to return to the same area makes it easier to compare another point.

Choose the pixel that represents the color

Decide what you are trying to reproduce before clicking. For a solid fill, select a point well inside the area, away from borders, shadows, text and rounded corners. For example, to match the fill behind a button label, choose an open patch of the button rather than a point touching a letter.

Sample a few nearby points and compare the values. If they agree, choose one and continue. If they differ, look closely at the area: you may have selected a boundary, a shadow, a gradient or a textured part of the image. Move farther into the area you want to represent and compare again. You are choosing a useful example of the color, not necessarily discovering one value that describes every pixel.

When the edge is the point

Sometimes the feature you want to match is the border, shadow or edge itself. In that case, sample that feature deliberately, then keep its value separate from the main fill. Compare a few points along it and choose the one that best represents the effect you want to reproduce. Apply it in the destination and judge the result at the size and against the background where it will appear.

Be cautious when sampling text. The edge of a letter can be blended with its background through antialiasing, so an edge pixel may differ from the intended text color. If the letters have an interior large enough to select, compare points inside the strokes with points near their edges. For very small text, you may need to try a candidate in context and adjust it by eye.

Gradients, textures and photographs

A gradient may call for samples from several positions rather than a single code. Note which point each value represents, such as the lighter end, middle or darker end. For a textured surface or photograph, compare a small group of points and pick the one that suits your purpose. Light, texture and camera noise can produce different values within an area that looks uniform.

If no one sample seems representative, make two or three swatches from candidates and compare them beside the source. Pick the result that works best for the area you are recreating.

Copy the code your destination accepts

Once you have a candidate, read the value shown by the sampling tool. Your destination application may offer a field for a color code, separate fields for color components, or a choice of formats. Check that field before deciding what to copy.

Format What to look for When to choose it
HEX A hexadecimal color value, often shown with a leading # Use it when the destination asks for HEX or provides a compatible code field.
RGB Values for red, green and blue Use it when the destination asks for RGB or provides separate component fields.
HSL Values for hue, saturation and lightness Use it when the destination accepts HSL and you want to work with those components.

HEX and RGB are two ways to represent the same RGB channel values. HSL expresses a color in terms of hue, saturation and lightness. Choose the format your destination accepts; a different format label alone does not mean you have selected a different intended color.

Copy the displayed value, switch to the destination, select the item you want to color and enter the value in its color field. Follow the field’s expected format, including any prefix or separators it asks for. If the destination has separate component fields, enter each component in the corresponding field instead of pasting the whole value into one box.

Before moving on, confirm that the value has been accepted and applied to the intended item. If the result looks unexpected, check for a missing character, a value entered in the wrong field or a different item selected. Keep the original sample available so you can compare it with any adjustments.

Check the match in context

Place the sampled color where it will actually be used. A swatch on its own is helpful for comparing candidates, but it cannot show every effect of the surrounding design. View a text color on its intended background, a border beside its fill, or a button alongside the other elements around it.

Transparency, blend effects, gradients and surrounding colors can all affect how a pasted color appears. If the result looks different from the source, check whether the source and destination use similar settings and backgrounds. A value sampled from a visible, blended area may need a different treatment when applied to an element with transparency or a blend effect.

Appearance versus original specification

A screenshot records a rendered appearance. Sampling it can help you reproduce what you see, but it does not establish the original brand specification or prove which value was entered in the source design. If an exact brand or design value matters, ask for the original specification or check the source design file when it is available. Use the sampled value as a practical comparison, rather than presenting it as an official code.

The same distinction matters for physical objects. A color sampled from a photograph reflects the photographed image, which can be affected by lighting, white balance and filters. If you need a close match to the object itself, compare your result with the object under the conditions in which the match will be judged, and ask for an authoritative color specification if one is needed.

If the first candidate is close but not useful in context, return to the image and sample another point, or adjust the value in your destination. Keep a note of the original candidate so you can reverse the change or compare both versions.

Build a palette and check readability

A single sample may be enough for a background or accent. A palette becomes useful when you need to recreate several distinct parts of an image or coordinate text, backgrounds and accents around the sampled color. Give each saved value a practical label, such as “main fill,” “border” or “text candidate,” so you remember what you sampled and where you plan to use it.

Start with the color that matters most, then add only the other colors you need. If you are matching an interface, you might sample its main fill, a border and a text color separately. If you are working from a photograph, you could compare a dominant area with one or two contrasting details. For a gradient, label the samples by position rather than treating one of them as the color of the whole gradient.

A palette tool can be useful for arranging or exploring candidate colors if it accepts the values you have. Check its inputs and outputs before relying on a particular workflow. Whether you use a tool or make simple swatches in your destination application, compare the candidates together and remove any that do not serve a purpose.

Check text and background together

A color that looks appealing as a swatch may be difficult to read when used for text. Check the actual text and background colors as a pair, including each combination you plan to use. If a contrast checker is available, enter the relevant values according to its instructions and review the result for that pair.

Also look at the finished text in its intended setting. If it is hard to read, try a different text or background candidate, then check the revised pair again. Repeat for any other text and background combinations you introduce. Save the values you settle on with their roles so you can apply them consistently.