Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
IcarusSosie opened this issue Jul 31, 2022 · 5 comments
Closed

Comments

@IcarusSosie
Copy link

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
Copy link
Owner

sainnhe commented Aug 1, 2022

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
Copy link
Author

Hi !

Thanks for answering so quick 😄

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
Copy link
Owner

sainnhe commented Aug 2, 2022

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 a0d7069

@sainnhe sainnhe closed this as completed Aug 2, 2022
@IcarusSosie
Copy link
Author

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 a0d7069 is actually needed now 😕

@sainnhe
Copy link
Owner

sainnhe commented Aug 2, 2022

So sorry for wasting you time, I'm not even sure a0d7069 is actually needed now 😕

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants