romkatv / powerlevel10k

A Zsh theme
MIT License
46.59k stars 2.19k forks source link

How to change the foreground color of git branch and branch name? #2790

Open Photonico opened 6 days ago

Photonico commented 6 days ago

Hi,

I tried these statements

# Version control system colors.
    typeset -g POWERLEVEL9K_VCS_CLEAN_BACKGROUND="#0078A0"
  typeset -g POWERLEVEL9K_VCS_CLEAN_FOREGROUND="#FFFFFF"

    typeset -g POWERLEVEL9K_VCS_MODIFIED_BACKGROUND="#14BE6E"
  typeset -g POWERLEVEL9K_VCS_MODIFIED_FOREGROUND="#FFFFFF"

    typeset -g POWERLEVEL9K_VCS_UNTRACKED_BACKGROUND="#0078A0"
  typeset -g POWERLEVEL9K_VCS_UNTRACKED_FOREGROUND="#FFFFFF"

    typeset -g POWERLEVEL9K_VCS_CONFLICTED_BACKGROUND="#FFC814"
    typeset -g POWERLEVEL9K_VCS_CONFLICTED_FOREGROUND="#FFFFFF"

    typeset -g POWERLEVEL9K_VCS_LOADING_BACKGROUND="#555555"
    typeset -g POWERLEVEL9K_VCS_LOADING_FOREGROUND="#FFFFFF"

But them does not work: image

I use a light theme, I prefer to set them "#FFFFF"

Cheers, Lu

Syphdias commented 3 days ago

Search for the function my_git_formatter in your .p10k.zsh. There your can change colors for different states. You will most likely want to change clean, i.e. local clean='%F{white}'.