This Gist supports this YouTube video:
https://www.youtube.com/watch?v=rnZYaQ7BfT8
from the YouTube playlist "Rick is Playing With Unix"
The scripts prompt1.sh through prompt7.sh walk through an examination of the PROMPT_COMMAND variable. To exercise these, do 'source' on each file.
The prompt-04-color-test scripts (3) walk through a few approaches for setting the color in a BASH prompt. To exercise these, do 'source' on each file.
From my experimentation, escape sequences seems to work the best!