Skip to content

Instantly share code, notes, and snippets.

@jojobyte
Created February 10, 2026 00:17
Show Gist options
  • Select an option

  • Save jojobyte/0afb5585cc327124c769721d5b979cfb to your computer and use it in GitHub Desktop.

Select an option

Save jojobyte/0afb5585cc327124c769721d5b979cfb to your computer and use it in GitHub Desktop.
Bookmarklet to invert the colors of a website. One click inverts, second click removes the inversion. Paste as the URL inside a bookmark.
javascript:void function(){
const d=document,q=d.querySelectorAll("style.dplgngr"),s=d.createElement("style");
if(q?.length)return q.forEach(a=>a.remove());
let b='#fff',i='95',h='180';
s.type="text/css";
s.className="dplgngr";
s.innerText=`
html { background-color: ${b}; }
html,img,video,iframe { filter: invert(${i}%) hue-rotate(${h}deg); }
`;
d.body.appendChild(s);
}();
javascript:void function(){const b=document,c=b.querySelectorAll("style.dplgngr");if(c%3F.length)return c.forEach(a=>a.remove());const d=b.createElement("style");d.type="text/css",d.className="dplgngr",d.innerText="html { background-color: %23fff; filter: invert(95%25) hue-rotate(180deg); }img,video,iframe { filter: invert(95%25) hue-rotate(180deg); }",b.body.appendChild(d)}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment