Created
May 30, 2022 16:45
-
-
Save brenogcota/d3bc714925c78bfce75b2076e8a9a81d to your computer and use it in GitHub Desktop.
Chrome default color picker snippet
This file contains 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
function copy(value) { | |
setTimeout(async()=>console.log( | |
await window.navigator.clipboard.writeText(value)), 3000); | |
console.log("Color: " + value); | |
} | |
window.colorPicker = () => new EyeDropper().open().then((color)=> copy(color.sRGBHex)) | |
window.colorPicker(); | |
// create color picker snippet | |
// press f12 and ctrl + o | |
// !color-picker | |
// click in document and press tab before 3s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment