Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

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.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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