Skip to content

Commit

Permalink
colours: tidy up text
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Wong committed Jul 22, 2013
1 parent bbf05ae commit 0249104
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions colours
Expand Up @@ -5,30 +5,30 @@
# Prints terminal colour scheme information
# Usage: ./colours [-v]

colur_hexes=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
colour_names=(black red green yellow blue magenta cyan white)
hexes=($(xrdb -query | sed -n 's/.*color\([0-9]\)/\1/p' | sort -nu | cut -f2))
names=(black red green yellow blue magenta cyan white)

# add -v argument for verbose output
if [[ $# -eq 1 && $1 == "-v" ]]; then
printf "┌────────────────────────────────────────────────────┐\n"
printf "preview name bash urxvt hex │\n"
printf "├────────────────────────────────────────────────────┤\n"
printf "┌────────────────────────────────────────────────────────┐\n"
printf "Preview Name Bash Urxvt Hex │\n"
printf "├────────────────────────────────────────────────────────┤\n"
for i in {0..7}
do
printf "%-30b" "│\e[0;$((30+$i))m ████████ $colour_names[i+1]"
printf "%-35b" "│\e[0;$((30+$i))m ████████ $names[i+1]"
printf %s "\e[0;$((30+$i))m "
printf "%-11b" "colors$i"
printf "$colur_hexes[i+1]\e[0m │\n"
printf "%-10b" "color$i"
printf "$hexes[i+1]\e[0m │\n"

printf "%-30b" "│\e[1;$((30+$i))m ████████ $colour_names[i+1]"
printf "%-35b" "│\e[1;$((30+$i))m ████████ bold $names[i+1]"
printf %s "\e[1;$((30+$i))m "
printf "%-11b" "colors$((i+8))"
printf "$colur_hexes[i+9]\e[0m │\n"
printf "%-10b" "color$((i+8))"
printf "$hexes[i+9]\e[0m │\n"
done
printf "└────────────────────────────────────────────────────┘\n"
printf "└────────────────────────────────────────────────────────┘\n"
else
printf "\e[1;37m BLK RED GRN YEL BLU MAG CYN WHT\n"
printf "────────────────────────────────────────────────────────────────────────────────────────\e[0m\n"
for i in {0..7}; printf "\e[$((30+$i))m █ $colur_hexes[i+1] \e[0m"; printf "\n"
for i in {8..15}; printf "\e[1;$((22+$i))m █ $colur_hexes[i+1] \e[0m"; printf "\n"
for i in {0..7}; printf "\e[$((30+$i))m █ $hexes[i+1] \e[0m"; printf "\n"
for i in {8..15}; printf "\e[1;$((22+$i))m █ $hexes[i+1] \e[0m"; printf "\n"
fi

0 comments on commit 0249104

Please sign in to comment.