1

Emacs seems to use the 16 colors which were defined in a color scheme inside the terminal emulator as default.

This works well, I would not want to switch to a whole emacs color profile. E.g I can specify the color of a "component" in emacs with a fixed color name or value like so:

(set-face-background 'mode-line "purple")

Is it also possible to tell Emacs to use one of the 16 defaults for this? like "color01" or sth.?

3

If you run emacs -nw, you can list all valid color names that can be used in the terminal. Here's an extract from M-x list-colors-display:

black                                                     #000000
red                                                       #cd0000
green                                                     #00cd00
yellow                                                    #cdcd00
blue                                                      #0000ee
magenta                                                   #cd00cd
cyan                                                      #00cdcd
white                                                     #e5e5e5
brightblack                                               #7f7f7f
brightred                                                 #ff0000
brightgreen                                               #00ff00
brightyellow                                              #ffff00
brightblue                                                #5c5cff
brightmagenta                                             #ff00ff
brightcyan                                                #00ffff
brightwhite                                               #ffffff
color-16                                                  #000000
...                                                       ...
color-255                                                 #eeeeee

As you can see, for some reason only colors 16 to 255 are numbered. Colors 0 to 15 use some take on the standard names of the 16-color terminal palette. To make use of them, use the identifiers above when customizing a theme.


If you're not in a terminal emulator, but would like to use its colors in a GUI Emacs, try the xresources-theme.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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