0

I don't know if it's the default colorscheme in every version, but the version I'm using, Emacs-26.3 downloaded from GNU ftp mirror, has this colorscheme by default. I don't know how to get the values of the colors used in this scheme. I want to use this exact color in a terminal.

So, if anyone knows how I can find out the hex values of the default colorscheme, please let me know.

1

What do you mean by "colorscheme", and more particularly, what do you mean by "the hex values of the default colorscheme"?

If you're asking about particular colors that you see, where do you see the colors you're interested in?

If they are for buffer text, put your cursor on some text with a particular color and do C-u C-x =. Buffer *Help* will tell you what face is used for that text and provide a link to its description, which shows any colors used (foreground, background, etc.).

If they are for the default frame background and foreground, use M-x describe-face default; the attributes of face default are used as frame defaults.

You can also use M-x list-colors-display, to see all of the available defined (named) colors, along with their hex RGB values. It's likely that the default colors are among those shown, and you can probably find colors that match what you see.

1

The default color theme (in Emacs-speak they're themes) isn't defined in a single place, but you can collect everything into one file by creating your own custom theme.

  1. start Emacs with emacs -Q to disable user and site-local configuration
  2. do M-x customize-create-theme RET y to create a customize buffer that includes basic faces.
  3. At the top of the buffer name your theme, and click the save button
  4. The mini-buffer/echo-area will give you the save location. Load your theme from there with C-x C-f.

Now you have a buffer with a "default" theme definition; basically a list of faces and their properties. Find the face your interested in and look at the :foreground and :background properties. You'll see that almost all of them are named colors. You can find the mapping of RGB values to names in rgb.txt in Emacs' etc directory. /Applications/Emacs.app/Contents/Resources/etc on macOS, and /usr/share/emacs/<version>/etc on Linux (well, Ubuntu at least), and here on GitHub. You can then use your favorite conversion tool to convert the decimal RGB values to hex.

If you're only interested in a few faces it may be easier, as @drew suggests, to pick them with C-u C-x =, and if they're named, look them up in rgb.txt

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.