ColorsNew

Color Picker from Image with HEX, RGB and OKLCH

Pick colours from an image, the screen or a colour wheel and copy HEX, RGB, HSL and OKLCH

100% client-side — your data never leaves your browserNo data stored or uploadedFree for lifetime · No signup

Screen eyedropper needs a Chromium browser (Chrome, Edge, Opera). Use the image picker below instead.

  • HEX#3b82f6
  • RGBrgb(59, 130, 246)
  • HSLhsl(217, 91%, 60%)
  • OKLCHoklch(62.3% 0.188 259.8)
White text
3.68:1 · AA Large
Black text
5.71:1 · AA
Pick a colour from an image

The image is drawn on a canvas in this tab and never uploaded.

Three ways to pick a colour

Colour wheel and sliders: the square swatch opens your browser's native colour picker, which on most systems shows a colour wheel or spectrum plus its own eyedropper. Underneath it, the Hue, Saturation and Lightness sliders let you nudge a colour precisely, for example to make a brand blue 10% lighter for a hover state, and the hex field accepts any 3- or 6-digit code you paste.

Screen eyedropper: in Chrome, Edge and Opera the Pick from screen button uses the EyeDropper API, which lets you click any pixel on your screen, including other windows, and returns its hex code. The browser shows its own magnifier and the page never sees your screen, only the single colour you chose. Firefox and Safari do not support this API yet, so the button is hidden there and the page tells you why instead of failing silently.

Color picker from image: choose a screenshot, logo or photo and it is drawn onto a canvas in this tab; click any point to read that exact pixel. Nothing is uploaded. Large images are scaled to 1,200 pixels wide for display, so on a photo with fine detail zoom into a smaller crop first if you need one specific pixel. This is the quickest hex code finder when a designer sends a PNG instead of a style guide.

HEX, RGB, HSL and OKLCH: which one to copy

Every pick is shown in four CSS formats with a copy button. HEX (#3b82f6) is the compact form used in design tools and most stylesheets. RGB (rgb(59, 130, 246)) is the same three channels in decimal, handy when you need to add transparency as rgb(59 130 246 / 50%). HSL describes a colour by hue angle, saturation and lightness, which makes it the easiest format to reason about when building lighter and darker shades by hand.

OKLCH is the newest: lightness, chroma and hue in the perceptually uniform OKLab space, supported by all current major browsers and used by Tailwind CSS v4 for its default palette. Equal steps in OKLCH lightness look like equal steps to the eye, which HSL does not guarantee; yellow and blue at the same HSL lightness look very different in brightness. The conversion here follows Björn Ottosson's published OKLab matrices from sRGB.

Contrast check against white and black text

The two preview tiles show white and black text on your colour with the WCAG 2 contrast ratio. Body text needs at least 4.5:1 for level AA and 7:1 for AAA; large text (about 24px, or 19px bold) needs 3:1, shown as AA Large. If neither tile passes, adjust the Lightness slider until one does.

The ratio is calculated exactly as WCAG defines it: each colour is converted from sRGB to linear light, weighted into a relative luminance (red 21%, green 72%, blue 7%, reflecting how sensitive the eye is to each), and the ratio is (lighter + 0.05) / (darker + 0.05). That is why a saturated yellow can pass with black text while a blue of the same HSL lightness needs white. For a full palette from a photo use the Image Color Palette Extractor, and to convert a value you already have use the Color Converter; both are linked below the tool.

How to use the Color Picker from Image with HEX, RGB and OKLCH tool

  1. 1

    Choose a starting colour

    Use the colour wheel swatch, paste a hex code, or press Pick from screen in a Chromium browser.

  2. 2

    Or pick from an image

    Click Choose image, then click any point on the picture to read that pixel's colour.

  3. 3

    Fine-tune with HSL sliders

    Drag Hue, Saturation and Lightness to adjust the colour while watching the swatch and contrast tiles.

  4. 4

    Copy the format you need

    Copy HEX, RGB, HSL or OKLCH, and check the white and black contrast ratings before using it for text.

Frequently asked questions

How do I get the hex code of a colour in an image?

Click Choose image, select the file, then click the spot you want. The pixel's colour appears as HEX, RGB, HSL and OKLCH. The image is processed on a canvas in your browser and never uploaded.

Why don't I see the Pick from screen button?

It uses the EyeDropper API, which is currently available only in Chromium-based browsers such as Chrome, Edge and Opera. In Firefox or Safari, take a screenshot and use the image picker instead, or use your browser's native colour dialog, which on some systems includes its own eyedropper.

What is OKLCH and should I use it in CSS?

OKLCH expresses a colour as perceptual lightness, chroma and hue. It is supported in all current major browsers and makes consistent shade scales easier because equal lightness steps look equal. Keep a HEX fallback only if you must support older browsers.

What contrast ratio do I need for accessible text?

WCAG 2 level AA requires 4.5:1 for normal text and 3:1 for large text; level AAA requires 7:1 and 4.5:1. The tiles show the ratio of your colour against pure white and pure black.

Related on TechLogHub

Get the next tool before you need it

One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.