diff --git a/README.md b/README.md index 780fad5..4109def 100644 --- a/README.md +++ b/README.md @@ -162,6 +162,7 @@ GIT_PROMPT_COMMAND_FAIL="${Red}✘-_LAST_COMMAND_STATE_ " # displays as ✘-1 fo - You can get help on the git prompt with the function ``git_prompt_help``. Examples are available with ``git_prompt_examples``. + A list of all available named colors is available with `git_prompt_color_samples` - If you make any changes to any file that is sourced by `gitprompt.sh`, you should run this command, so that the next prompt update will find all the diff --git a/git-prompt-help.sh b/git-prompt-help.sh index 791bc7f..8b9b390 100755 --- a/git-prompt-help.sh +++ b/git-prompt-help.sh @@ -58,3 +58,18 @@ These are examples of the git prompt: EOF } +git_prompt_color_samples() { + + showColor() { + local color=$(eval echo "\${$1}") + echo -e "${color}$1${ResetColor}" | sed 's/\\\]//g' | sed 's/\\\[//g' + } + + while (( x < 8 )) ; do + showColor ${ColorNames[x]} + showColor "Dim${ColorNames[x]}" + showColor "Bold${ColorNames[x]}" + showColor "Bright${ColorNames[x]}" + (( x++ )) + done +}