Troubleshooting & How-Tos 📡 🔍

Reverse the Colors when Viewing a Web Page

It’s not as good as a website that actually supports dark and light modes. Or as extensions that try to calculate an alternate color scheme. But if you want a quick-and-dirty solution to turn light web pages dark or dark webpages light, you can create a shortcut to just invert the colors on whatever page you’re looking at.

In a discussion on Mastodon, suggested the following bookmarklet, though he couldn’t remember where he’d seen it:

javascript:void( = "invert()" )

I immediately thought, “this can be super useful!” But that always switches to negative. What if you want a way to switch it back? So I modified it to work as a toggle:

javascript:void( = ( == '') ? 'invert()' : '')

Try it here: Invert Colors

Copy that second code to a new bookmark, or on Firefox you can just drag the link to your bookmarks bar.