5

I have Emacs 24.5.1, installed zenburn-theme off of melpa-stable and loaded the theme in my .emacs with (load-theme 'zenburn). I like all the colours except the background. It's a bit too bright.

How do I set the background colour to a darker colour?

3 Answers 3

9

You can modify zenburn's face definitions in your .emacs. I use this to avoid mucking up the background of other themes.

(with-eval-after-load "zenburn-theme"
  (zenburn-with-color-variables
    (custom-theme-set-faces
     'zenburn
     ;; original `(default ((t (:foreground ,zenburn-fg :background ,zenburn-bg))))
     `(default ((t (:foreground ,zenburn-fg :background ,zenburn-bg-1)))))))
2
  • 1
    Great answer, thanks! For those who are interested, you can use zenburn-bg-05, zenburn-bg-1, or zenburn-bg-2 for varying shades of darkness.
    – dpritch
    Apr 18, 2019 at 13:47
  • That works for me on startup, but when I reload .emacs with M-x load-file I get the brighter background again? Why could that be happening? (Using emacs --daemon)
    – user313032
    Feb 22, 2022 at 4:01
1

You can change the color of the background by adding this to your .emacs file:

(custom-set-faces
 '(default ((t (:background "blue"))))
 )

Note, the core bit here is:

'(default ((t (:background "blue"))))

As you might already have custom-set-faces declared if you made any modifications previously.

1

You might also want to look at the hc-zenburn theme (hc-zenburntheme on MELPA). It probably changes more than just the background, but the darker background is all that I generally notice.

Your Answer

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

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