Where a colour code helps
- Matching a brand: take a client’s logo and use its exact blue in a slide, a document or a website.
- Web design: copy colours from a screenshot of a design you like into your CSS as HEX or HSL.
- Home and craft: get a code for a wall, fabric or yarn colour from a photo, then look for the nearest paint or thread online.
- Accessibility checks: pick the text and background colours of a screenshot and compare their contrast.
Getting a true colour from a photo
A camera photo is never a perfect record of a colour: warm indoor light, shadows and phone processing all shift it. For the closest match, photograph the object in daylight, pick from a flat, evenly lit area, and use the 5 × 5 average. Screenshots and digital artwork are exact, so a single pixel is fine there. Edges between two colours are blended in most pictures, so pick from the middle of a shape, not its border.
Worked example: a logo colour
Open a PNG of a logo and tap the middle of its blue lettering. With the 1-pixel sample the result is #1E4172, which is rgb(30, 65, 114), hsl(215, 58%, 28%) and roughly cmyk(74%, 43%, 0%, 55%). For a lighter shade of the same blue, keep the hue at 215 and raise the lightness in your design app.
Reading the four formats
| Format | Looks like | Use it in |
|---|---|---|
| HEX | #1E4172 | Websites, Canva, Figma, Photoshop, Word |
| RGB | rgb(30, 65, 114) | CSS, PowerPoint, Excel, video editors |
| HSL | hsl(215, 58%, 28%) | CSS, making tints and shades |
| CMYK | cmyk(74%, 43%, 0%, 55%) | A starting point for print; confirm with your printer |
Picking several colours? Each one goes into the list under the result; tap a swatch to see its codes again, or copy all the HEX codes at once.
Frequently asked questions
How do I find the colour code of something in a picture?
Why does the same area give slightly different colours?
What is the difference between HEX, RGB, HSL and CMYK?
Can I pick colours from a screenshot or a logo?
How do I get all the main colours at once?
Last updated: 2026-11-26