How do I change the highlight color for selected text with Emacs / deftheme?
What you're looking for is the region
face. For example:
(set-face-attribute 'region nil :background "#666")
In addition to tungd's solution. You could also then change the font color to make it more readable. E.g. to white
(set-face-attribute 'region nil :background "#666" :foreground "#ffffff")
You can use the customize interface.
M-x customize-face
When prompted for which face, enter region
. Then you'll see
something like:
Using customize makes it easy to experiment with lots of colors. Try
clicking [ Choose ]
to access the color-picker), then
[ Apply and Save ]
. It also nicely organizes your customizations
into a single file (rather than further polluting your init.el
).