Skip to content

Instantly share code, notes, and snippets.

@brenogcota
Created May 30, 2022 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brenogcota/d3bc714925c78bfce75b2076e8a9a81d to your computer and use it in GitHub Desktop.
Save brenogcota/d3bc714925c78bfce75b2076e8a9a81d to your computer and use it in GitHub Desktop.
Chrome default color picker snippet
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