Powerlevel9k / powerlevel9k

Powerlevel9k was a tool for building a beautiful and highly functional CLI, customized for you. P9k had a substantial impact on CLI UX, and its legacy is now continued by P10k.
https://github.com/romkatv/powerlevel10k
MIT License
13.46k stars 948 forks source link

[Enhancement] adds support for truecolor/24bit #1262

Closed Syphdias closed 5 years ago

Syphdias commented 5 years ago

This enables users to use truecolor/24bit colors if zsh (>=5.7) and the terminal support it.

To display similar colors if the terminal does not support truecolor, we should document somewhere to recommend the following lines to add to the .zshrc:

[[ $COLORTERM = *(24bit|truecolor)* ]] || zmodload zsh/nearcolor

After this change the following colors formats are supported (this should also be documented):

P9K_DIR_PATH_HIGHLIGHT_FOREGROUND='001'     # numeric 001-256 (1-16 are dynamically used for themes for example)
P9K_DIR_PATH_HIGHLIGHT_FOREGROUND='#d10000' # hex code #000000-#ffffff
P9K_DIR_PATH_HIGHLIGHT_FOREGROUND='red'     # name, see `p9k::get_color foreground`

I write "should" because the Customization page is in the GitHub Wiki and I didn't want to touch it since it's for master not next.

resolves #1259 //cc @migmolrod //cc @romkatv

bhilburn commented 5 years ago

Such a simple change for such a cool feature!

dritter commented 5 years ago

As stated in gitter, I am going to merge this. Thx @Syphdias .