22

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.

caisah
  • 4,056
  • 1
  • 23
  • 43

1 Answers1

22

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

deprecated
  • 2,775
  • 14
  • 15
  • 1
    Yep, using `shr-color-visible-luminance-min` makes the content of the page readable. Thanks. – caisah Nov 14 '14 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 '16 at 07:40