sellout / emacs-color-theme-solarized

Emacs highlighting using Ethan Schoonover’s Solarized color scheme
http://ethanschoonover.com/solarized
MIT License
1.15k stars 201 forks source link

weird colors on command line emacs #27

Closed ghost closed 13 years ago

ghost commented 13 years ago

I installed the Solarized palette for gnome-terminal here: https://github.com/sigurdga/gnome-terminal-colors-solarized

But command line emacs looks weird. It looks mostly correct, except for one color.

Dark: http://i.imgur.com/eTNeB.png Light: http://i.imgur.com/rHN9W.png

Dark is obvious; light's normal text isn't dark blue. Is the terminal thing wrong or is this a bug?

illusori commented 13 years ago

You might find this useful: https://github.com/sellout/emacs-color-theme-solarized/pull/22

If Emacs isn't aware of what real colours are displayed by your terminal, it'll choose the closest matching colour in what it thinks the palette is, which may be wildly different if you've changed the palette to non-standard colours like solarized.

My patch updates what Emacs thinks the tty palette is to match the colours requested by emacs-color-theme-solarized so it will always use the correct palette slot.

ghost commented 13 years ago

This doesn't seem to work. Now even though the theme is set to light, the background becomes blue and the foreground text is still orange. The dark theme is still messed up like my screenshot. I'm using gnome-terminal and not OS X though, I don't know if that matters.

illusori commented 13 years ago

Quite possibly, not sure if gnome-terminal is palette driven or full colour: my fix is for palette driven and might need some tweaks to make sure it's setting and choosing the right colours even then.

It might also be the case that gnome-terminal might be being detected as 8-colour rather than 16-colour, the following snippet of emacs lisp will tell you that:

(display-color-cells (selected-frame))

To run it, just copy it into your scratch buffer and press ctrl-j when you have the cursor on the end of the line, it should display 8 or 16 or 256 or something on the line beneath: if it's 8 then you're not going to have the right colours being used.

ghost commented 13 years ago

Aha, it was detecting an 8-color palette. I set TERM to xterm-256color and it worked. By the way, it seems on your fork that the light version is still dark on gnome terminal. Closing this issue though.