Last active
September 7, 2025 04:16
-
-
Save Blumed/fcba0633ca35c3ccc2308a52ffea6bd4 to your computer and use it in GitHub Desktop.
Color picker bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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