The Color Input & The Color Picker
The Color Input & The Color Picker êŽë š
HTML has a color input that is pretty decent:
<input type="color">
Thatâs it. Support across the board. However, browsers can and do have different approaches to what happens when the input is used.
has itâs own UI

uses the macOS system color picker

has itâs own UI, allows you to open macOS system color picker

has itâs own UI (Edge looks the same)

uses the Windows system color picker

Pixel 8


Ultimately: the user activates the input, may choose a color using the provided UI, and the color becomes the inputs value.
Note
Itâs not my favorite that you can only get 6-digit HEX colors in and out of it, like #F06D06
and the like. No transparency, no other formats. I have a feeling display-p3 color formats like OKLCH will have a real popularity boom in coming years (because they are sweet: more colors, more logical) and weâll start wanting better integration, like with color inputs.
The Eyedropper
Note that some of those color panels have an eyedropper function. Those are awfully handy. Sometimes the color Iâm shooting for is right on my screen somewhere, and a color eyedropper is the fastest and easiest way to grab it.
Turns out there is a native API for an eyedropper! You donât have to use a color input to access an eyedropper.
You can test for support like:
if ("EyeDropper" in window) {
}
And use it like:
// used in case you need to cancel the experience
const abortController = new AbortController();
const eyeDropper = new EyeDropper();
try {
const result = await eyeDropper.open({ signal: abortController.signal });
console.log(result.sRGBHex);
} catch (e) {
console.error(e);
}
Demo
Anywhere you use a color input, you might as well offer an eyedropper, too.
Test for support first, of course, but I think that statement above largely holds true. Offering a dedicated eyedropper button means saving users a step in case thatâs what they are trying to do anyway.
And using the native one is nice, as I find itâs generally a nicer color picker than anything integrated into app itself. Eyedroppers built into very major design tools like Adobe Photoshop and Figma largely only let you pick colors from inside the documents themselves, not from anywhere on the screen. Boooo.
The demo above shows how a color input and eyedropper button can work together right next to each other.
Support
Support for color inputs is good across the board, but support for the EyeDropper API, at the time of this writing, is just Chromeânâfriends. No Safari or Firefox.
But the real UX story isnât quite that clear.
In Firefox, the color input opens the native color picker (both macOS and Windows) and that native picker has an eyedropper. So Firefox users have decently quick access if they need it.
In Safari, the native color picker is an extra click away, but itâs still gettable.
Chrome on Android has no support.

I would have assumed iOS didnât either, and itâs true that it doesnât support the EyeDropper
API, but in a quick play of iOS 17 on an iPhone 15, the native UI for a color picker has an eye dropper (!!). Thatâs pretty cool. I would think that brings Safari generally a lot closer to offering the API directly.