Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color themes look weird on the comandline GNU emacs #23

Open
amukiza opened this issue Nov 16, 2014 · 6 comments
Open

Color themes look weird on the comandline GNU emacs #23

amukiza opened this issue Nov 16, 2014 · 6 comments

Comments

@amukiza
Copy link

amukiza commented Nov 16, 2014

When I use the color themes on the GUI Emacs, everything looks great but unfortunately I love using emacs in the comandline more than the GUI. Is there a way I fix my emacs (command line) to work well with these awesome colors?

@owainlewis
Copy link
Owner

Hi. This is something I've been meaning to fix for a while. I will look into fixing these color themes for terminal Emacs.

@collenjones
Copy link

+1. This is an awesome repo. Would love to use it in the command line.

@owainlewis
Copy link
Owner

@purcell Any ideas on this?

@purcell
Copy link
Contributor

purcell commented Nov 24, 2014

These themes currently tell Emacs that - whatever the colour capabilities of the current frame - it should use the exact hex colours you've supplied. (That's what the t means on lines like this.)

In GUI frames, you'll get the desired result, and in terminal frames, you'll get results that vary in all sorts of... interesting ways. If you use a 256-colour terminal, the hex colours will (I believe) be rounded to the nearest colour in the 256-colour palette. If it's a 16-colour palette, then the rounding is more acute. (Note also that applying a "theme" in the terminal emulator will generally change the 16-colour palette.)

If this issue is about the colours not being exactly right in a 256-colour terminal, well, that can never be fixed, because there are only 256 colours available. But it's possible (and likely) that the themes don't look good in a regular 16-colour ansi terminal, and that can be addressed.

So the correct (and OCD) way to fix this would be to specify two sets of attributes for face each face definition: each would have a different class specifier in order to target either terminal or GUI frames, and would have a different hex colour.

e.g.

(hl-line ((t (:background ,hickey-light-gray))))

might end up something like this:

(hl-line (((min-colors 89) (:background ,hickey-light-gray)) ; 256-colour and GUI
          (t               (:background gray))))             ; low-colour terminals

There's more about this in the elisp manual: https://www.gnu.org/software/emacs/manual/html_node/elisp/Defining-Faces.html

@owainlewis
Copy link
Owner

Awesome thanks. I knew you were the guy to ask 👍

@purcell
Copy link
Contributor

purcell commented Nov 24, 2014

I see my reputation exceeds me. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants