A quick reference for ANSI colors and text formatting in the terminal.
git clone https://github.com/AFaria20s/terminal-colors.git
cd terminal-colors
bash setup.sh
source ~/.zshrc # or ~/.bashrcThen just type:
colorsIf you prefer to set it up yourself:
cp colors.sh ~/.colors.sh
echo "alias colors='bash ~/.colors.sh'" >> ~/.zshrc
source ~/.zshrc- Text formatting — bold, dim, italic, underline, blink, reverse, strikethrough
- Foreground colors — normal and bright variants
- Background colors — normal and bright variants
Each entry is rendered with its own escape code, so you see exactly what you get.
Not in the script since there are hundreds of values, but the syntax is simple:
echo -e "\033[38;5;208m fg 256 \033[0m" # 256 fg (0–255)
echo -e "\033[48;5;208m bg 256 \033[0m" # 256 bg (0–255)
echo -e "\033[38;2;255;100;0m fg rgb \033[0m" # truecolor fg
echo -e "\033[48;2;255;100;0m bg rgb \033[0m" # truecolor bgMIT