Skip to content

Instantly share code, notes, and snippets.

@Blumed
Last active September 7, 2025 04:16
Show Gist options
  • Select an option

  • Save Blumed/fcba0633ca35c3ccc2308a52ffea6bd4 to your computer and use it in GitHub Desktop.

Select an option

Save Blumed/fcba0633ca35c3ccc2308a52ffea6bd4 to your computer and use it in GitHub Desktop.
Color picker bookmarklet
const bookmarklet = { name: "bookmarklet__color-picker", version: "1.0" };
(async () => {
try {
const selectedColor = await new EyeDropper().open();
navigator.clipboard.writeText(selectedColor.sRGBHex);
console.log(`${bookmarklet.name}: ${bookmarklet.version}`);
} catch (error) {
console.log(`${bookmarklet.name} : ${bookmarklet.version} : ${error}`);
}
})();
// Paste the one line below into your bookmark url field for this code to work
javascript:(function(){const bookmarklet={name:"bookmakrlet__color-picker",version:"1.0"};(async()=>{try{const o=await(new EyeDropper).open();navigator.clipboard.writeText(o.sRGBHex),console.log(`${bookmarklet.name}: ${bookmarklet.version}`)}catch(o){console.log(`${bookmarklet.name} : ${bookmarklet.version} : ${o}`)}})();}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment