Closed rlue closed 6 years ago
Thanks for the first issue!
The problem with gvim was because of a bug in the script. Before applying highlights the script checked if terminal has 256 color support. But it missed the check for graphical UI. Should be fixed now with this change:
For alacritty: the notermguicolors
version is probably correct (judging from the yellowish text) - as it was hard to make the scheme work with the 256 palette. This might be improved in the future (if possible) right now for each real color I simply selected the closest match from 256 space.
And the termguicolors
version - would be nice to have some code in the screenshot so we could see how the colors look like.
Awesome!
right now for each real color I simply selected the closest match from 256 space.
How many different colors do you use in this scheme? In my experience, the best way to achieve that kind of color fidelity is to specify custom ANSI colors in the terminal emulator and use those instead. Do you think that would be a viable option for sacredforest?
And the termguicolors version - would be nice to have some code in the screenshot so we could see how the colors look like.
Whoops, good point — I'll get on this later today.
The bugfix for gvim totally did it! Closing this issue.
Maybe this belongs in a separate issue (or maybe it's not even an issue at all), but to answer your question...
With set termguicolors
, it comes out totally in black and white:
For reference, here's a comparison of sacredforest in gvim (right) and with set notermguicolors
in the terminal (left):
Thank you a lot for detailed responses.
I made one more change: removed the if statement entirely so the colors are applied unconditionally. Maybe you can check if that makes it work on alacritty?
Also regarding specifying custom ANSI colors for terminal emulators: I am actually doing that myself on my setup. But in that case I have to use color numbers 0-15 (as these are the ones that are changed).
Not sure how to make this work with colorscheme. If scheme uses colors 0-15: it will be off when terminal colors are not set. If it uses the whole range (0-256) like now, then changing the ANSI colors will have no effect on the scheme. Maybe you have an idea/suggestion of how to do this correctly?
I made one more change: removed the if statement entirely so the colors are applied unconditionally. Maybe you can check if that makes it work on alacritty?
It might be easier on your users if you applied these changes on a separate bugfix
branch (or similar), then asked me to install the colorscheme against that branch with, e.g.,
Plug 'KKPMW/sacredforest-vim', { 'branch': 'bugfix' }
This way, people don't pull your in-progress / experimental changes when updating the plugin.
Not sure how to make this work with colorscheme. If scheme uses colors 0-15: it will be off when terminal colors are not set. If it uses the whole range (0-256) like now, then changing the ANSI colors will have no effect on the scheme. Maybe you have an idea/suggestion of how to do this correctly?
The other color scheme I use (hybrid) makes the ANSI / 256-color choice user-configurable: users with the appropriate term colors set are expected to add the following line to their .vimrc
:
let g:hybrid_custom_term_colors = 1
I can't imagine that there's a way for vim to detect the ANSI colors defined by the terminal emulator, so this is the best approach I can imagine.
Also, just updated to 6289f2d and tried applying the colors in the terminal — I don't see any differences, visually. Were you hoping that it would change with termguicolors
or notermguicolors
? (I think the notermguicolors
output is close enough, for a 256-color palette...)
Also, just updated to 6289f2d and tried applying the colors in the terminal — I don't see any differences, visually. Were you hoping that it would change with termguicolors or notermguicolors?
I was mainly hoping this would stat working on alacritty (where you showed that it's black and white). I also looked around the some other schemes and majority of them don't use if clauses to check if terminal has 256 colors - they just change the colors and that's it.
My main hope was that alacritty wasn't detected as a 256 terminal in that vimscript and so no colors were set for it. And then removing the check would change the colors.
The other color scheme I use (hybrid) makes the ANSI / 256-color choice user-configurable: users with the appropriate term colors set are expected to add the following line to their .vimrc:
Thanks. I will try to make this work some time later (maybe in the weekend).
I'm running gvim 8.1 on Debian testing, and installed sacredforest via vim-plug. Here's what it looks like with
set bg=dark
:and here's what it looks like with
set bg=light
:It's no better in the terminal (I'm using alacritty with custom ANSI colors based on vim-hybrid). Here it is with
set termguicolors
:and here it is with
set notermguicolors
:Have I missed something?