Sampling pixels with the 9x9 loupe and clipboard paste
Designers and front-end developers rarely want to save temporary screenshots to disk just to grab a brand hex code. Opening an image in your browser via file drop or clipboard paste lets you pick pixel colors from images without uploading proprietary mockups to external servers.
Instant Ctrl+V screenshot inspection and 1,200 px analysis scaling
Pressing Ctrl+V (or Cmd+V on macOS) triggers a window paste listener that reads image/* clipboard items directly into memory. Dropped files accept JPG, PNG, WebP, AVIF, HEIC, GIF, and sanitized SVG graphics.
According to the MDN CanvasRenderingContext2D.drawImage() documentation, the tool draws the decoded bitmap onto an off-screen canvas scaled down only if its longest edge exceeds 1,200 px (MAX_ANALYSIS_SIDE). Once you pick a color, you can match frame colors in a photo border padding tool.
Arrow-key pixel nudging and transparent pixel handling
A 9×9 pixel loupe beside the preview swatch magnifies the region around your cursor, highlighting the exact center cell with a crisp dual border and displaying (x, y) coordinates underneath. Focus the canvas and press Arrow keys to step 1 px at a time, or hold Shift with Arrow keys for 10 px jumps.
If you click an area where alpha is below 0.02, the main swatch switches to a grey-and-white checkerboard and displays rgba(0, 0, 0, 0). Moving onto an opaque pixel or clicking any extracted swatch restores live format and contrast readouts immediately.
Why use 3x3 or 5x5 averaging instead of a 1x1 pixel?
Single-pixel sampling reads the exact RGBA value at one coordinate, which works for flat UI icons but often misleads on compressed photographs. Switching the Eyedropper menu to 3×3 average or 5×5 average computes the mean color across neighboring pixels to neutralize JPG macroblock grain.
Smoothing JPEG compression grain and camera sensor noise
In samplePixelAverage, radius 0 reads 1 pixel (1×1), radius 1 averages 9 pixels (3×3), and radius 2 averages 25 pixels (5×5). Averaging smooths out chrominance subsampling artifacts on painted walls, skin tones, and fabric textures without blurring distant edges.
When 1x1 exact sampling is better for crisp UI sprites
Choose 1×1 exact when inspecting pixel art, hairline 1 px borders, or vector exports where adjacent pixels belong to distinct UI elements. If you are auditing vector icons before sampling, you can strip redundant SVG editor metadata to keep fills clean.
| Eyedropper mode | Sampling grid | Pixels averaged | Best input type |
|---|---|---|---|
| 1×1 exact | Radius 0 | 1 px | UI screenshots, pixel art, 1 px borders |
| 3×3 average | Radius 1 | 9 px | Product photos, gradients, compressed JPGs |
| 5×5 average | Radius 2 | 25 px | Textured fabrics, skies, noisy camera shots |
| Dominant palette | Perceptual k-means | 4 to 12 swatches | Full-image brand themes and design tokens |
Extracting dominant palettes to CSS, Tailwind, and JSON
Manual eyedropping finds one accent at a time, whereas Dominant palette summarizes an entire composition automatically. Moving the Swatches slider between 4 and 12 (default 8) re-clusters the image in a background Web Worker without freezing the page.
Perceptual k-means clustering across 4 to 12 swatches
The worker skips pixels with alpha below 64, runs 12 iterations of weighted perceptual k-means clustering, and merges centroids closer than 900 squared perceptual distance units. Each resulting swatch card shows its hex code and percentage share of opaque image area, and clicking any swatch selects it for inspection.
Because clustering runs inside a dedicated Web Worker with transferable pixel buffers, dragging the Swatches slider between 4 and 12 updates the palette smoothly without blocking pointer movement on the main canvas.
Exporting :root variables, Tailwind @theme tokens, and JSON
Tip: Click Tailwind under Export palette to copy ready-to-paste @theme tokens (–color-palette-1 through –color-palette-8) straight into a Tailwind v4 stylesheet.
As defined in the W3C CSS Color Module Level 4 Specification, modern stylesheets support space-separated rgb(), hsl(), hwb(), and oklch() notations natively. Switching Export palette to CSS outputs :root custom properties, while JSON exports an array containing hex, rgb, hsl, oklch, and sharePercent. You can also fine-tune individual shades in Color converter.
How perceptual OKLCH and WCAG contrast improve web design
Every sampled pixel or clicked swatch updates six copyable color formats alongside live accessibility scores. Seeing OKLCH lightness and WCAG contrast ratios side by side prevents low-contrast text mistakes before tokens reach production CSS.
Converting sRGB pixels into HEX, HSL, HWB, and OKLCH
Each color updates HEX, RGB, HSL, HWB, OKLCH, and Legacy RGB rows with dedicated copy buttons. OKLCH expresses perceptual lightness (L%), chroma (C), and hue (H), making it easier to judge visual brightness than HSL lightness alone.
Unlike legacy hex strings, OKLCH lets you adjust hue across buttons or badges while keeping perceived brightness steady across an entire design system.
Evaluating White text and Black text against AA and AAA thresholds
Per the W3C WCAG 2.1 Accessibility Guidelines, contrast is computed from linearized sRGB relative luminance ((L1 + 0.05) / (L2 + 0.05)). The two Aa cards score your sampled background against White text (#ffffff) and Black text (#000000), reporting AAA (>= 7:1), AA (>= 4.5:1), AA large text only (>= 3:1), or Fails (< 3:1). Checking these ratios upfront helps you place readable captions over photos with confidence.