andreyorst / powerline.kak

Kakoune modeline, but with passion
MIT License
50 stars 8 forks source link

Colors do not properly transition when using 4-bit colors #7

Open Crote opened 5 years ago

Crote commented 5 years ago

screenshot from 2019-02-09 18-32-52

See screenshot. Ignore the actual colors for a moment, that's what happens when you use the default color scheme with terminal colors set to Solarized and it makes it easy to see that there's actually something wrong.

The problem is the transition between the different plugins. Note that the colors of the separator does not properly seem to inherit the color from its right neighbour. This happens with any theme where the colors are used by name instead of by rgb value, and still happens when the indicators are in different positions. With other (terminal) color schemes it's less noticeable, but it's still there.

Here's a real-life example with #6, note that it only occurs on one segment and is very subtle: screenshot from 2019-02-09 18-49-23

andreyorst commented 5 years ago

does this still an issue?

Crote commented 5 years ago

Yes, no changes.

andreyorst commented 5 years ago

Hm. I don't see this happening. I'm tesitng it in GNOME Terminal with default solarized-dark scheme and it seem to work fine with solarized-dark-termcolors colorschemes for kakoune and powerline.kak

image

andreyorst commented 5 years ago

This indeed happens wher terminal color scheme differs from what Kakoune uses, image

but that's not the issue with the powerline.kak, because it uses colors that has been given by the powerline theme, not kakoune theme. And if powerline theme uses terminal colors (red, black, etc.), and Kakoune theme doesn't use those and defines it's own, we have the result as above.

andreyorst commented 5 years ago

You should also take into account that we can't really set the background for mode info. It uses the same background as the modeline itself, that's why it is always looks unthemed. If the colors theme use mismatch with the background of the modeline, you can see these edges.

Crote commented 5 years ago

My demonstration with different colors was probably a poor one, and that may not be related. But, as seen in my second screenshot, there does seem to be something weird going on, with both Kakoune and Powerline set to solarized-light-termcolors. I'm aware of the mode_info background coloring, but that's not quite the case here. When I manually change the module code of mode_info to use a different background, the spacing and the separator use that color, but the mode_info background stays the same, as expected. But the second screenshot shows that the default background color, which matches the mode info, does not propagate properly. Additionally, the same happens with the git module.

I believe I figured out what's happening here: we're trying to combine a bright color with a non-bright color. So, looking at the combination of, say, bufname followed by git, the separator should be bright-cyan on the left, and white on the left. However, what we get is a bright-cyan background with a bright-white foreground. Swapping them around does work properly, for some reason...

The colors seem to be handled fine, it's the assumption that a background color is actually the same color when used as a foreground which is wrong. Reliable test case: :echo -markup "{white,bright-cyan}{bright-cyan,white}"

This seems to be an upstream bug, so I've filed https://github.com/mawww/kakoune/issues/2842 .