drewdeponte / git-ps-rs

Official git-ps Rust implementation - the future of git-ps
https://git-ps.sh
MIT License
78 stars 8 forks source link

feature: color configuration for gps list #284

Closed Alizter closed 8 months ago

Alizter commented 8 months ago

Here is configuration support for the colors in gps list.

We are using the builtin decoders for ansi_term which means we can do things like:

[list]
alternate_colors = true 
patch_series_background.color = "Blue"
patch_series_background.color_alternate = "Green"
patch_series_foreground.color.RGB = [195, 234, 222]
patch_series_foreground.color_alternate.RGB = [235, 23, 55]

leading to:

image

As you can see, it is a bit buggy as I think I've messed up the alternating coloring for the patch stacks. In this example, there should be 3 green patches rather than 2.

@drewdeponte hopefully you can build on this.

drewdeponte commented 8 months ago

I have cherry-picked this into my patch stack, reworked them a bit to clean things up and manually integrated them. Therefore, I am closing this PR as the cleaned up versions have been integrated into main and seem to be working correctly.