Is there any extension or easy way to invert colors in emacs?
I tend to show code a lot through screen sharing and often a light theme is better while the dark is more comfortable for me to work alone.
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityIs there any extension or easy way to invert colors in emacs?
I tend to show code a lot through screen sharing and often a light theme is better while the dark is more comfortable for me to work alone.
You could use two different color themes and switch between them.
(global-set-key [f5] (lambda () (interactive) (load-theme 'sanityinc-tomorrow-day t)))
(global-set-key [f6] (lambda () (interactive) (load-theme 'sanityinc-tomorrow-night t)))
(load-theme 'THEME-NAME t)
. That has to be wrapped in (lambda () (interactive) .. )
if binding directly to a key.
Jun 16, 2015 at 10:24
color-theme-sanityinc-tomorrow-...
this works. But I've changed my answer as you suggested.
There's a -rv
switch you can use to boot up Emacs in reverse video mode, however I've found it not to work in combination with custom themes.
Your question asks about "inverting colors", which I interpret as "complementing colors". But then you also talk about themes.
You can use library Palette (palette.el
) to obtain the complement of any color in a WYSIWYG way (so you can easily tweak the result if you like).
You can use library hexrgb.el
to obtain the complement of any color programmatically (command hexrgb-complement
).
You can use library Do Re Mi or library Icicles to incrementally adjust colors or face foregrounds/backgrounds.
You can use these things (above) to define a new theme starting from an existing theme.
You can use library Icicles to cycle among existing themes (color themes or custom themes).
M-x invert-face RET default RET