7

I just ran into a weird issue while tweaking my colour theme for terminal Emacs. The background wasn't appearing as black as expected, but grey, even though the background was set to #000000. So I opened the 'customize-face' dialog, and then opened the 'choose colour' option for background. This presents the following list:

enter image description here

Notice that the first colour, black, is actually grey, despite being listed as #000000. Stranger, is there is a second colour named color-16, with the same code #000000, and it is full black (see the bottom of the image).

The upshot is if I set a colour to #000000 or black, I actually get grey, but if I set the colour to color-16, I get black.

This doesn't happen in GUI Emacs, where #000000 is called black, and produces true black. There is no color-16 in my GUI emacs.

This is a bit awkward as I'd like to have the same color theme for GUI and terminal emacs, but black seems to mean different things. Can anyone explain this?

Emacs 27.0.50
Debian Linux
gnome terminal

  • 4
    It's just a problem with the color scheme of your terminal. I don't know what terminal you're using, but I assume it's just one of these 256 color terminals. Try tweaking the color scheme so colors match your expectations. – DoMiNeLa10 Oct 17 '17 at 14:52
  • I see. I'm using gnome-terminal, and the problem disappears in xterm (which only has 8 colors). I'll look into how gnome terminal sets its colors. – Tyler Oct 17 '17 at 14:59
8

Turns out this was a problem with gnome-terminal. I fixed it by opening the profile preferences from the gnome-terminal menu bar, selecting colours, and changing the built-in scheme to Linux console.

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.