powerline-shell
powerline-shell copied to clipboard
Improve hostname colorization
There are 2 changes included:
a) The function getOppositeColor in color_compliment.py did not work properly. It was mixing value ranges from 0-1 and ranges from 0-255.
b) When hostname colorization is enabled, then a random number is being generated for the foreground color of the hostname and the opposite color is being calculated for the background color.
However, when running in a shell with dark background color it typically looks better if the background color of the hostname is "bright". So I introduced a noption in the configuration named "hostname.dark" that (when set to true) picks the brighter of the two colors for the hostname as the background color (by swapping the two if the foreground color is the brighter one in the first place).
This would be great to have... I keep getting unreadable hostnames, making this functionality useless.
@b-ryan (or other maintainers) - any reason this isn't being merged?
I have the same issue with unreadable hostnames. But I am not sure if this PR solves this.
You might take a look at this issue. https://github.com/b-ryan/powerline-shell/issues/381