Closed mhartington closed 6 years ago
I am having this issue as well. Probably because the themes are defined as hex color values rather than terminal colors. Emacs is trying to match them to the closest 256 color equivalent. I'm pretty new to emacs so I'm not sure how to fix it.
I'm also trying to figure this out. I'm willing to help if someone could give me some guidance on how to debug. Or at least an up-to-date resource on how emacs handles colors and face -- it's overwhelming to sift through. These issues from solarized seem related:
https://github.com/sellout/emacs-color-theme-solarized/issues/60 https://github.com/sellout/emacs-color-theme-solarized/issues/62
I also noticed that the light themes look pretty close to correct already. If I run (set-background-color "black")
, the glaring orange background goes away.
Is this even the right issue tracker @mkaito or should we take this discussion over to base16-shell
?
I just provide this issue for ELPA convenience. Development happens in base16-builder
. I am "officially" the maintainer of the emacs template, I guess, but I'm not actually very experienced with emacs themes, especially when it comes to emacs in the console. I've never gotten that to work since we switched to deftheme
.
Perhaps if you take discussion over to base16-builder
, more people would see it. I'm eager to get this solved, since it also affects my daily workflow.
If it's worth anything, base16-shell also messes vim's colours up.
I think I've got a solution. See pull request #13. With that get consistent colors in rxvt and iTerm in OS X.
I have created a pull request to fix this in the base16 builder: https://github.com/chriskempson/base16-builder/pull/347 by extending the solution of @AnthonyDiGirolamo a bit.
That's great! I'm not sure upstream is actually doing anything. Last news I heard was that they wanted to split themes into their own packages/repos, but it seems like nothing has happened since.
@mkaito As base16-builder project is kind of stale, it is possible for you to generate the new theme files with my pull request and release them to melpa for emacs?
There's a fork of the base16-builder package which solves this issue.
They used this method: https://github.com/auduchinok/base16-builder/commit/77714c235b04231dc8e25e8156d526f93043d729
Alternatively, this repo could switch to using that base16-builder as it seems more active.
This should be resolved in 51b0fcdce617047141eec43567aae64a9bce9f63. It was based off of the base16-xresources colors and should work if you have a base16 terminal scheme in use as well.
However, I haven't tested with the -256 variety, so I'm not closing this just yet.
I believe this has been fixed. I've tried it against the base16-default.dark and base16-default.dark.256 iterm2 color schemes.
Please let me know if you have any additional problems.
I spoke too soon. Still needs to be fixed for the 256 schemes.
Still have this issue with emacs 24.5.1
. Tried under gnome-terminal and urxvt.
Also, comments and the mode line in all themes seem to have the same weird pale violet color instead of the color corresponding to brightblack.
Before setting the background to black.
Comment should be gray in the oceanicnext theme, but it's violet.
On vim for comparison.
Do you have a screenshot of what you're seeing? And you're using base16-gnome-terminal, base16-shell, and base16-emacs together?
I added screenshots to my comment. Yeah, I'm using base16-gnome-terminal, base16-shell and base16-emacs.
I don't have any issues with vim.
What's the value of $TERM?
I always seem to have issues reproducing issues with base16-shell interactions... so feel free to provide any information you think might help me reproduce this.
I think this may be an issue with how the setup handles 256 color terminals using base16-shell... right now we just let emacs do the color conversions (since passing in the actual colors will let emacs convert them to the 256 colorspace provided by the terminal), but that may not be the best approach because base16-shell mangles the 256 colorspace.
TERM=xterm-256color
I spent way too much time on this, and I have no clue why it isn't working. Can't think of anything more I could add. :/
Out of pure curiosity, does emacs display properly if you don't source base16-shell? (Not a solution, just for debugging)
Similarly, does it display properly with TERM=xterm?
Nope.
I'm really not sure how to fix this... this displays correctly for me using emacs 25.1.1 both with and without base16-shell on gnome-terminal 3.22.1 with vte 0.46.1.
If you're interested in fixing this, there's a chance that the base16-shell-colors variable (in base16-theme.el) could be changed to use the additional colorspace provided by base16-shell. I believe this would need to be customized before the themes are loaded, so it may be easiest to mess around with it in the file itself.
In a few hours, there will be a new build on melpa... can you test that and let me know if it fixes this for you? I don't use terminal emacs, so I'm not 100% sure my hacked-together setup will match what everyone is trying to do.
It's better. The annoying background is gone, and the color of the comments is correct now, but there are still some issues:
The comment slashes (//) are yellow, the highlighted (current) line is green and the bar is yellow. :/
@zagortenay333 Are you using base16-shell? Also (forgot to mention it) but you may need to put (setq base16-theme-use-shell-colors t)
before loading the theme.
Setting setq base16-theme-use-shell-colors t
solved the problem. Thx!
I guess this issue can be closed now.
Btw, this should really be mentioned in the README.
Do you reckon this could be automated by checking whether emacs is running in a terminal?
I'm seeing this issue as well. The behavior without setq base16-theme-use-shell-colros t
is almost the same as for zagortenay333, but with it is still very wrong:
I'm using most recent commit on base16-emacs/master and the base16-shell. My .Xresources is configured directly from base16-xresources.
[2017-03-28 12:03:41] samir@host ~
$ echo $TERM
rxvt-unicode-256color
[2017-03-28 12:03:44] samir@host ~
$ emacs --version
GNU Emacs 24.5.1
@samir-memsql Yes, you need base16-theme-use-shell-colors
to use this with base16-shell for now.
@zagortenay333 I'll add it to the readme. Just wanted to make sure it worked first, since I use gui emacs and I'm sure there was something weird about my setup.
@mkaito Yes, this would be possible, but I'd prefer to default to the non-256 colorspace version, similar to what the vim theme does.
The base16-vim theme does something similar. I may change the variable name, but this general approach will probably be used.
@belak Sorry for the confusion, my point was that the colors appear very wrong with or without base16-theme-use-shell-colors
.
What terminal/TERM value?
[2017-03-28 13:01:09] samir@host ~
$ dpkg --list | grep rxvt
ii rxvt-unicode-256color 9.21-1build1 amd64 multi-lingual terminal emulator with Unicode support for X11
[2017-03-28 13:01:12] samir@host ~
$ echo $TERM
rxvt-unicode-256color
Well, I've added another option (and removed the previous one).
For 256 color terminals, there are 3 options:
These can be set using the base16-theme-256-color-source
variable.
For people still having trouble using terminal
or base16-shell
, I'd recommend using colors
.
If there's anyone still having trouble with this, please let me know. I plan on closing this as soon as I get a chance to update the documentation. Thanks to everyone for your feedback and help testing this!
I'm still having issues with this.
(setq base16-theme-use-shell-colors t)
(use-package base16-theme :ensure t :config (load-theme 'base16-google-light t))
The setting changed quite a while back. There's some more information here: https://github.com/belak/base16-emacs/blob/master/base16-theme.el#L17
This may fix it for you: (setq base16-theme-256-color-source "base16-shell")
That works great!
Using emacs inside of iterm, with base16-shell running, colors aren't showing up correctly. Any ideas?