sainnhe / edge

Clean & Elegant Color Scheme inspired by Atom One and Material
MIT License
860 stars 56 forks source link

Most of the text is background-colored in lazygit via toggleterm #61

Closed IcarusSosie closed 2 years ago

IcarusSosie commented 2 years ago

Hi !

I'm running neovim with a lazygit setup inside of a floating toggleterm terminal.

Here is a screenshot of what that looks like : edge_plus_lazygit_in_toggleterm

Most of the text is invisible due to it having the same color as the background. I get the same results when running nvim via Yakuake, Xfce4-terminal, or neovide.

For reference, here is lazygit run directly from cli, with an approximate edge theme recreation in yakuake, where i matched the edge hex colors to the base yakuake light theme : fake_edge_plus_lazygit

Other than that it looks quite great!

This isn't an urgent problem to solve btw, i can still use git from the command line. I'm not familiar with vimscript or lua enough to figure it out on my own, but if you can point me in the right direction to fix the issue I'd be more than happy to submit a PR.

sainnhe commented 2 years ago

What about this patch?

diff --git a/colors/edge.vim b/colors/edge.vim
index 57b712e..4d6cf4c 100644
--- a/colors/edge.vim
+++ b/colors/edge.vim
@@ -328,14 +328,14 @@ endif
 if ((has('termguicolors') && &termguicolors) || has('gui_running')) && !s:configuration.disable_terminal_colors
   " Definition
   let s:terminal = {
-        \ 'black':    &background ==# 'dark' ? s:palette.bg0 : s:palette.fg,
+        \ 'black':    &background ==# 'dark' ? s:palette.bg3 : s:palette.fg,
         \ 'red':      s:palette.red,
         \ 'yellow':   s:palette.yellow,
         \ 'green':    s:palette.green,
         \ 'cyan':     s:palette.cyan,
         \ 'blue':     s:palette.blue,
         \ 'purple':   s:palette.purple,
-        \ 'white':    &background ==# 'dark' ? s:palette.fg : s:palette.bg0
+        \ 'white':    &background ==# 'dark' ? s:palette.fg : s:palette.bg3
         \ }
   " Implementation: {{{
   if !has('nvim')

Save the text as patch.diff and execute git apply patch.diff in the root directory of edge color scheme.

IcarusSosie commented 2 years ago

Hi !

Thanks for answering so quick :smile:

It does work in making the text readable but the contrast is very low, it is kinda taxing on the eyes. bg_grey seems like the most readable to me. bg_grey is the color used for the foreground text in the second screenshot in my original post. I think grey_dim would probably also work and heighten the contrast between background and foreground a bit.

sainnhe commented 2 years ago

Honestly this is not an issue of this color scheme, it's an issue of lazygit itself. For no reason it should use a white foreground because the program does not know if a terminal emulator color scheme is light or dark.

I can't make more compromise, because some other programs might use white as background, in that case bg_grey will be too dark.

Fixed in https://github.com/sainnhe/edge/commit/a0d7069e98271ea8bac1400f784a2c5a153f9d88

IcarusSosie commented 2 years ago

Oh wow, I had not even considered lazygit being the issue.

I looked into it and it does seems to support configuration options for a light theme, as seen here.

So sorry for wasting you time, I'm not even sure https://github.com/sainnhe/edge/commit/a0d7069e98271ea8bac1400f784a2c5a153f9d88 is actually needed now :confused:

sainnhe commented 2 years ago

So sorry for wasting you time, I'm not even sure https://github.com/sainnhe/edge/commit/a0d7069e98271ea8bac1400f784a2c5a153f9d88 is actually needed now 😕

It is necessary indeed, some programs directly use white as foreground color and may not support light mode.