Leveraging Chromium’s built-in EyeDroper API —which I wrote about earlier this year— Patrick Brosset created an extension for Chromium that allows you to pick a color from anywhere on your screen.
In an accompanying blogpost he also explains how he built it:
Back when I worked on the [EyeDroper API] article, I got interested in whether the API would also work in browser extensions, which it does! So I built a small extension that lets you grab colors from your screen, and store them locally for later reuse.
Chromium EyeDropper Extension →
Chromium EyeDropper Extension Source (GitHub) →
How I built an Eye Dropper browser extension →