Skip to content

Instantly share code, notes, and snippets.

@MacroMan
Created June 24, 2019 10:40
Show Gist options
  • Save MacroMan/e14eba837360f8d9b60d7167aeb12310 to your computer and use it in GitHub Desktop.
Save MacroMan/e14eba837360f8d9b60d7167aeb12310 to your computer and use it in GitHub Desktop.
Bookmark doodle colour
javascript:var BDColor="000";!function(e,n){function o(e){BDColor=e.target.className,i()}function t(e){27==e.which&&i()}function i(){r.removeChild(a),r.removeEventListener("keydown",t)}function d(e,n,o){e.addEventListener(n,o)}var r=n.body,l=["000","009","090","099","900","909","990","CCC","999","00F","0F0","0FF","F00","F0F","FF0","FFF"],a=n.createElement("div"),c=a.style;c.position="fixed",c.left="100px",c.top="100px",c.zIndex="10000";for(var F=0;F<l.length;F++)a.appendChild(function(e){var t=n.createElement("div");t.className=e;var i=t.style;return i.display="inline-block",i.backgroundColor="#"+e,i.width="25px",i.height="25px",d(t,"click",o),t}(l[F]));n.body.appendChild(a),d(r,"keydown",t)}(window,document);void(0);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment