induwara.lk
induwara.lkImage · Color

Image Color Picker — HEX, RGB, HSL & CMYK

Drop a photo, screenshot, or design mockup and click any pixel to read its exact colour. You get HEX, decimal RGB, HSL, and CMYK in one shot — each with a one-click copy. Runs entirely in your browser. No upload, no signup, sources cited below.

By Induwara AshinsanaUpdated May 11, 2026
Image Color PickerHEX · RGB · HSL · CMYK
Files stay on your device

Everything runs in your browser. Nothing is uploaded.

What this does

Drop a photo, screenshot, or design mockup above and click anywhere on it to capture that pixel's exact colour. You get HEX, decimal RGB, HSL, and CMYK in one shot, each with a one-click copy. Move slowly to preview hovered pixels in real time; switch to Average 5×5 if you need to smooth past compression noise. Nothing leaves your device.

Selected
Click the image to capture a colour
Hovered
Move over the image to preview
Active value
Hover or click to see live values

Values

HEX
RGB
HSL
CMYK
Recent picks appear here after your first capture. Click any chip to restore that colour as the active value.

Conversions follow the W3C CSS Color Module Level 3 RGB → HSL algorithm and the un-color-managed RGB → CMYK identity. See "Sources & references" below.

How it works

The picker decodes your image into a local HTMLCanvasElement and reads pixels via getImageData. That call returns a flat RGBA buffer in row-major order — for any pixel at (x, y) the byte offset is (y × width + x) × 4. Once we have the raw sRGB triplet, three pure conversions run:

  1. HEX — each 0–255 channel padded to two hex digits and joined with a leading #. Upper-case for paste-compatibility with every editor.
  2. RGB → HSL follows the algorithm in CSS Color Module Level 3, §4.2.4: normalise to [0, 1], take max and min across the channels, derive lightness as the midpoint, derive saturation from the spread, and pick a hue formula based on which channel is the maximum. The same maths is used inside Chromium, Photoshop, and Figma — the differences you sometimes see across tools are pure rounding artefacts, never a real disagreement.
  3. RGB → CMYK applies the un-color-managed identity formula: K = 1 − max(R, G, B), then C = (1 − R − K) / (1 − K), and likewise for M and Y. Without an ICC profile this is the best CMYK a browser can offer; print shops always re-separate against their own press profile anyway, so the values here are digital-preview accurate and a useful starting point.

For confidence the tool also runs an HSL → RGB round-trip on every captured colour. The recovered RGB is compared to the original; a per-channel error ≤ 1 out of 255 is the maximum a correct conversion can produce (one unit of integer rounding per direction), and every sample taken with this tool falls inside that bound. If a captured colour ever showed a larger error, the round-trip note at the bottom of the card would flag it — that is the credibility check.

The Average 5×5 sampling mode reads a 25-pixel square centred on the cursor and returns the integer mean per channel. JPEG compression introduces colour noise that can make a single-pixel reading unrepresentative; averaging is the standard remedy and matches the behaviour of Photoshop's eyedropper at the "5 × 5 average" setting.

Worked examples

Pure red — RGB(255, 0, 0)

HEX #FF0000

  1. r' = 1, g' = 0, b' = 0
  2. max = 1, min = 0, lightness = (1 + 0) / 2 = 0.50
  3. saturation = d / (max + min) = 1 / 1 = 1.00
  4. max is the red channel → hue = (g − b) / d = 0 → 0°
  5. HSL → (0°, 100%, 50%)
  6. K = 1 − 1 = 0 → CMYK (0%, 100%, 100%, 0%)

Sky blue — RGB(135, 206, 235)

HEX #87CEEB

  1. r' ≈ 0.5294, g' ≈ 0.8078, b' ≈ 0.9216
  2. max = b, min = r, d ≈ 0.3922
  3. lightness = (max + min) / 2 ≈ 0.7255 → 73%
  4. lightness > 0.5 → saturation = d / (2 − max − min) ≈ 0.71 → 71%
  5. max is the blue channel → hue = (r − g) / d + 4 ≈ 3.29 → /6 × 360 ≈ 197°
  6. HSL → (197°, 71%, 73%)
  7. K = 1 − 0.9216 ≈ 8%; C ≈ 43%, M ≈ 12%, Y = 0
  8. CMYK → (43%, 12%, 0%, 8%)

Saffron accent — RGB(243, 156, 18)

HEX #F39C12

  1. r' ≈ 0.9529, g' ≈ 0.6118, b' ≈ 0.0706 (induwara.lk brand amber)
  2. max = r, min = b, d ≈ 0.8824
  3. lightness ≈ 0.5118 → 51%
  4. lightness > 0.5 → saturation ≈ 0.90 → 90%
  5. max is the red channel → hue = (g − b) / d ≈ 0.61 → /6 × 360 ≈ 37°
  6. HSL → (37°, 90%, 51%)
  7. K ≈ 5%; C = 0, M ≈ 36%, Y ≈ 93%
  8. CMYK → (0%, 36%, 93%, 5%)

Pure black — RGB(0, 0, 0) (edge case)

HEX #000000

  1. max = min = 0 → equal-channel branch fires
  2. hue = 0, saturation = 0, lightness = 0
  3. HSL → (0°, 0%, 0%)
  4. K = 1 → CMYK collapses to (0%, 0%, 0%, 100%) (pure black ink)

Frequently asked questions

Sources & references

The conversion formulas in this tool were last cross-checked against the W3C and Adobe sources on 2026-05-11. The page is reviewed whenever the W3C CSS Color spec ships a breaking change (none expected in CSS Color 4).

Related tools

Rate this tool
Be the first to rate

Comments & feedback

Spotted a bug or want an improvement? Tell us — our team reviews every comment, and good ideas get built. Comments are public and anonymous.

Found a bug, edge case, or want to suggest an improvement?

Email me at [email protected] — most fixes ship within 24 hours.