pgdouyon / vim-yin-yang

Low contrast black/white color scheme for Vim
MIT License
86 stars 11 forks source link

feature request: merge to single file colorscheme, don't change &background #4

Open kevinlawler opened 1 month ago

kevinlawler commented 1 month ago

Merge the two colorschemes into a single file and a single colorscheme with two different appearance, one for each background, and don't force change the background. I would suggest something like "yinyang.vim" or "yin-yang.vim". In the current environment most dual (dark and light) colorschemes ship as one file. Such a single file wouldn't change the background color. As it currently is, both of the separate yin and yang force-change the background color. The current split files also break color switchers and so on, because the two files jump back and forth in the list between each other, in addition to changing the background, which makes it difficult to do all-light or all-dark comparison passes in the switcher. Because of the force-change to background color, they also break whatever built-in dark/light mode settings you might be using. I like the yin and yang schemes but the separate is making me consider uninstalling them and they would benefit from being modernized.

Background changes are forced here: https://github.com/pgdouyon/vim-yin-yang/blob/77ed628fe5d23abfe297d58a0f46ac94bbc987f6/colors/yin.vim#L103 https://github.com/pgdouyon/vim-yin-yang/blob/77ed628fe5d23abfe297d58a0f46ac94bbc987f6/colors/yang.vim#L100

pgdouyon commented 1 month ago

Just want to make sure I understand the problem correctly. If you have your background set to light and then select the yin color scheme from your color switcher, yin will incorrectly change the background to dark and load the dark theme instead of respecting the background setting. Instead the color scheme should leave the background set to light and just load the colors used for the yang theme which would be easier to do if it was one theme instead of two?

Can you link the color switcher you’re using so I can learn more about how it works? Also, if possible, could you list/link some popular dual color schemes that ship as one file I can reference?

kevinlawler commented 1 month ago

Yes, with the caveat that you could probably accomplish this by leaving it as two files, but that would be wrong for other reasons: merging the two files is important because the current files are "half" themes that occupy two slots in the scheme queue.

I use https://github.com/xolox/vim-colorscheme-switcher now and I used to use https://github.com/qualiabyte/vim-colorstepper. Playing with these using nmap <F7> <Plug>ColorstepNext should give you an idea.

I also use https://shifty.natethompson.io/en/ on macOS, this may or may not be of use to you. I map ctrl-shift-d to toggle dark/light mode for the OS.

kevinlawler commented 1 month ago

As far as colorschemes go, there are many that do what you ask.

This https://github.com/foxbunny/vim-amber/blob/master/colors/amber.vim is not that popular but it has a minimal implementation that works in both light and dark mode. More popular ones that I use, with more attendant cruft, are:

solarized.vim
gruvbox-material.vim  two-firewatch.vim  iceberg.vim  lucius.vim
nord.vim              PaperColor.vim     pencil.vim   kanagawa.vim
pgdouyon commented 1 month ago

I'm still trying to think through the implementation details and figure out how to deal with potentially breaking users' configs on update, so may still change how this all works. But if you want to be on the bleeding edge and your plugin manager supports branches you can use the unify-themes branch which should fix the problem. I'll probably keep that branch around for a while so it won't be going anywhere.

Unified theme name is yin-yang

kevinlawler commented 1 month ago

branch seems to work so far. tested in neovide and macvim