I just installed emacs 24.4 and I've started using eww. But one annoying thing is that when I visit google.com I get a grey background which makes text really hard to read for my theme.

This is how it looks: enter image description here

Is there any way I could change the color of the background? I first thought I could customize eww faces but there is no option for this. I'm also curious why is this background color there, in the first place.

1 Answer 1


I'm not sure why the background color is there either, but it seems to be controlled by the function shr-color-check, which is supposed to check that the contrast between the fg and bg is sufficient for the text to be visible. I agree that the readability is not very good in your example. Luckily, there are some variables that can be tweaked: shr-color-visible-luminance-min and shr-color-visible-distance-min. I tried setting

(setq shr-color-visible-luminance-min 70)

and the results are much more readable:

Screenshot of eww window with better contrast

  • 1
    Yep, using shr-color-visible-luminance-min makes the content of the page readable. Thanks.
    – caisah
    Nov 14, 2014 at 10:20
  • I've had luck with those variables for gnus emails before, but then I came across emails where I actually had to decrease the luminance-min to make things more readable (stupid AirBnB html), so eventually I just did (advice-add #'shr-colorize-region :around (defun shr-no-colourise-region (&rest ignore)))
    – unhammer
    May 31, 2016 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.