4

I am using the monokai theme from https://github.com/oneKelvinSmith/monokai-emacs, and I would like to override the background to be black. Following the override instructions, I tried:

(setq monokai-background "#000000")
(load-theme 'monokai t)

However, this does not seem to work. What am I missing?

1
  • What you typed worked for me. I got a pure black background w/ monokai.
    – g-gundam
    Oct 4, 2022 at 7:56

3 Answers 3

0

Try the following

(setq customize-set-variable "#000000")
(load-theme 'monokai t)

or better see "How to change face in particular theme locally?"

1
  • 1
    This looks wrong: there is no variable called customize-set-variable to set - it is a function, so do you mean (customize-set-variable 'monokai-background '#000000)?
    – NickD
    Jan 14, 2020 at 14:10
0

You can add this to the end of your .emacs file:

(set-background-color "black")

I've tried it on my machine and you can read more here: http://ergoemacs.org/emacs/emacs_playing_with_color_theme.html

0

Try loading the theme, THEN changing the background color. Your existing code allows the theme to set the color after you've changed it.

(load-theme 'monokai t)
(set-background-color "black") 

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.