Skip to content

Instantly share code, notes, and snippets.

@amelialaundy
Last active March 10, 2018 04:13
Show Gist options
  • Save amelialaundy/485c8df307e34dcdda2c6898406237d6 to your computer and use it in GitHub Desktop.
Save amelialaundy/485c8df307e34dcdda2c6898406237d6 to your computer and use it in GitHub Desktop.
get all colours available in terminal and their corresponding number https://github.com/sorin-ionescu/prezto/tree/master/modules/spectrum
#!/bin/bash
color(){
for c; do
printf '\e[48;5;%dm%03d' $c $c
done
printf '\e[0m \n'
}
IFS=$' \t\n'
color {0..15}
for ((i=0;i<6;i++)); do
color $(seq $((i*36+16)) $((i*36+51)))
done
color {232..255}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment