Skip to content

Instantly share code, notes, and snippets.

@robertcdawson
Last active September 16, 2020 07:55
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 robertcdawson/100cf9f24f3c55f06cd177569cc6feb1 to your computer and use it in GitHub Desktop.
Save robertcdawson/100cf9f24f3c55f06cd177569cc6feb1 to your computer and use it in GitHub Desktop.
Quickly visually estimate color contrast ratio of text within or over images.
// Run in console:
const images = document.querySelectorAll('img');
images.forEach(image => {
image.style.filter = "blur(5px) grayscale(1)";
});
// Or, make a bookmarklet:
javascript:const images = document.querySelectorAll('img'); images.forEach(image => { image.style.filter = "blur(5px) grayscale(1)"; });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment