themerdev / themer

🎨 themer takes a set of colors and generates themes for your apps (editors, terminals, wallpapers, and more).
https://themer.dev
MIT License
5.52k stars 117 forks source link

use 256 colour codes in @themerdev/vim-lightline #119

Closed lafleurdeboum closed 3 years ago

lafleurdeboum commented 3 years ago

Resolves #118 .

I propose to use 256 colour-codes in vim-lightline, because CLIs like vim and nvim don't support html colour notation. This may lead to huge discrepancies, highlighting codes not being read at all.

I understand using this lower definition may lead to subtle discrepancies between terminal and vim GUIs, but I consider it a lower price to pay. Hope some would agree ?

I copied the decoding algorithm from @themerdev/vim.

netlify[bot] commented 3 years ago

👷 Deploy request for themer-dev pending review. Visit the deploys page to approve it

🔨 Explore the source changes: 077770bfeda25f6a33ddd194326745acb0c516c0

mjswensen commented 3 years ago

Thank you, @lafleurdeboum , for your effort on this! I like the idea of being able to support console Vim in addition to users setting termguicolors.

How about both? Since the render() function in themer packages returns an array of files, we could ship ThemerVimLightline.vim with the current color notation (to keep the package backwards compatible) and ThemerVimLightline.cterm.vim with the 256 color codes as you have it here. What do you think?

lafleurdeboum commented 3 years ago

Actually, running

:let g:lightline#colorscheme#default#palette

shows that lightline colorscheme supports both code systems in the same dictionary (I don't know how vimscript calls its dictionaries, sorry). So render() could return both. I've tested this feature and updated the MR accordingly.

  Le vendredi 12 novembre 2021 à 06:01 -0800, Matt Swensen a écrit :

Thank you, @lafleurdeboum , for your effort on this! I like the idea of being able to support console Vim in addition to users setting termguicolors. How about both? Since the render() function in themer packages returns an array of files, we could ship ThemerVimLightline.vim with the current color notation (to keep the package backwards compatible) and ThemerVimLightline.cterm.vim with the 256 color codes as you have it here. What do you think? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

mjswensen commented 3 years ago

Actually, running :let g:lightline#colorscheme#default#palette shows that lightline colorscheme supports both code systems in the same dictionary (I don't know how vimscript calls its dictionaries, sorry). So render() could return both. I've tested this feature and updated the MR accordingly.

Fantastic!! Thank you!

lafleurdeboum commented 3 years ago

I pushed a modified last commit with a correction from prettier ; the CI should succeed now.

mjswensen commented 3 years ago

Sorry for the delay on this, @lafleurdeboum — these changes have now been published at @themerdev/vim-lightline version 3.2.0. ✅