Skip to content

Instantly share code, notes, and snippets.

@victor-rds
Created September 23, 2024 13:32
Show Gist options
  • Select an option

  • Save victor-rds/afa39c33d86a5e24a8b6c48fe95fa205 to your computer and use it in GitHub Desktop.

Select an option

Save victor-rds/afa39c33d86a5e24a8b6c48fe95fa205 to your computer and use it in GitHub Desktop.
Color index for Powerline theme of Bash-it (https://github.com/Bash-it/bash-it)
#!/bin/bash
# Print colors index for Bash-It Powerline Theme
# https://github.com/Bash-it/bash-it/
function clean() {
echo -e "\033[0m $1"
}
for ((j=0; j<=15; j++)); do
echo -n -e "\033[48;5;${j}m $(printf '%03d' ${j}) \033[0m"
done
clean "\n"
for ((i=16; i<=231; i+=36)); do
for ((j=i; j<i+36 && j<=231; j++)); do
echo -n -e "\033[48;5;${j}m $(printf '%03d' ${j}) \033[0m"
done
clean
done
clean
for ((j=232; j<=255; j++)); do
echo -n -e "\033[48;5;${j}m $(printf '%03d' ${j}) \033[0m"
done
clean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment