I have color config of my shell

PROMPT='%{$fg_bold[red]%}➜ %{$fg_bold[green]%}%p %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%} % %{$reset_color%}'

how to use hex color code?


I do not believe that you can use hex color codes with zsh, or even with any shell. To my knowledge, standard Linux terminals can only display certain pre-defined colors. With that in mind, I doubt that hex color codes have been coded into zsh, or even could be, as that would force your terminal/tty to use non-standard colors, some of which it might not have the capability to use.


That's right you can't use hex colors. There are only 8 available colors:

30 - black
31 - red
32 - green
33 - yellow
34 - blue
35 - magenta
36 - cyan
37 - white

however you can change what colors these color names represent in you terminal preferences.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.