<p>I program with Emacs on Ubuntu (Hardy Heron at the moment), and I like the default text coloration in the Emacs GUI. However, the default text coloration when Emacs is run in the terminal is different and garish.</p>

<p>How do I make the colors in the terminal match the colors in the GUI?</p>

[{'answer_id': 63965, 'author': 'HD.', 'author_id': 6525, 'author_profile': 'https://Stackoverflow.com/users/6525', 'pm_score': -1, 'selected': False, 'text': "<p>I don't think that is possible in such a general way.  With the terminal you are usually bound to some pre-defined colors (with things like gnome-terminal you can adjust these colors -- but you are still stuck to a predefined, limited number of colors).</p>\n"}, {'answer_id': 63990, 'author': 'pupeno', 'author_id': 6068, 'author_profile': 'https://Stackoverflow.com/users/6068', 'pm_score': 2, 'selected': False, 'text': '<p>I\'m not sure if it is possible, as the GUI may have more capabilities than the terminal (yes, I\'ve seen GUI terminals with only 16 colors very recently). It may depend on how the terminal is set. At any rate I would play with <a href="http://www.emacswiki.org/cgi-bin/wiki?ColorTheme" rel="nofollow noreferrer">Color Theme</a>.</p>\n\n<p>Anyway, why are you using Emacs in both, the terminal and the GUI? Generally people find one or the other appealing and use only that one. If you are using Emacs remotely, maybe you want to run it locally and use <a href="http://www.gnu.org/software/tramp/" rel="nofollow noreferrer">Tramp</a> to open files remotely, or as root.</p>\n'}, {'answer_id': 64585, 'author': 'insipid', 'author_id': 8649, 'author_profile': 'https://Stackoverflow.com/users/8649', 'pm_score': 7, 'selected': False, 'text': '<p>You don\'t have to be stuck to your terminal\'s default 16 (or fewer) colours. Modern terminals will support 256 colours (which will get you pretty close to your GUI look).</p>\n\n<p>Unfortunately, getting your terminal to support 256 colours is the tricky part, and varies from term to term. <a href="http://www.xvx.ca/~awg/emacs-colors-howto.txt" rel="noreferrer">This page</a> helped me out a lot (but it <em>is</em> out of date; I\'ve definitely gotten 256 colours working in gnome-terminal and xfce4-terminal; but you may have to build them from source.) </p>\n\n<p>Once you\'ve got your terminal happily using 256 colours, the magic invocation is setting your terminal type to "xterm-256color" before you invoke emacs, e.g.:</p>\n\n<pre><code>env TERM=xterm-256color emacs -nw\n</code></pre>\n\n<p>Or, you can set TERM in your <code>.bashrc</code> file:</p>\n\n<pre><code>export TERM=xterm-256color\n</code></pre>\n\n<p>You can check if it\'s worked in emacs by doing <code>M-x list-colors-display</code>, which will show you either 16, or all 256 glorious colours.</p>\n\n<p>If it works, then look at <code>color-theme</code> like someone else suggested.</p>\n\n<p>(You\'ll probably get frustrated at some point; god knows I do every time I try to do something similar. But stick with it; it\'s worth it.)</p>\n'}, {'answer_id': 40964993, 'author': 'Ali Zand', 'author_id': 1499655, 'author_profile': 'https://Stackoverflow.com/users/1499655', 'pm_score': 0, 'selected': False, 'text': '<p>A little late response but I had the problem with the black background showing up as grey. I fixed it by playing around with palette.</p>\n\n<p>edit > Profile Preferences > Color > Palette</p>\n'}, {'answer_id': 60620286, 'author': 'Arseniy Alekseyev', 'author_id': 8294974, 'author_profile': 'https://Stackoverflow.com/users/8294974', 'pm_score': 0, 'selected': False, 'text': '<p>I was able to get pretty close with emacs 26.</p>\n\n<p>I followed the Emacs FAQ to get 24-bit colors working:\n<a href="https://www.gnu.org/software/emacs/manual/html_mono/efaq.html#Colors-on-a-TTY" rel="nofollow noreferrer">https://www.gnu.org/software/emacs/manual/html_mono/efaq.html#Colors-on-a-TTY</a></p>\n\n<p>And then I changed the xterm-standard-colors variable:</p>\n\n<pre><code>(set \'xterm-standard-colors\n  \'(("black"          0 (  0   0   0))\n    ("red"            1 (255   0   0))\n    ("green"          2 (  0 255   0))\n    ("yellow"         3 (255 255   0))\n    ("blue"           4 (  0   0 255))\n    ("magenta"        5 (255   0 255))\n    ("cyan"           6 (  0 255 255))\n    ("white"          7 (255 255 255))\n    ("brightblack"    8 (127 127 127))\n    ("brightred"      9 (255   0   0))\n    ("brightgreen"   10 (  0 255   0))\n    ("brightyellow"  11 (255 255   0))\n    ("brightblue"    12 (92   92 255))\n    ("brightmagenta" 13 (255   0 255))\n    ("brightcyan"    14 (  0 255 255))\n    ("brightwhite"   15 (255 255 255)))\n  )\n</code></pre>\n\n<p>(I did not change the "bright*" colors because I don\'t use them, and they don\'t seem to be available in <code>list-colors-display</code> in X11 emacs, anyway)</p>\n\n<p>With those two changes, colors look pretty much identical between X11 and terminal for me.</p>\n'}]
['https://Stackoverflow.com/questions/63950', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/-1/']