33 lines
534 B
Bash
Executable file
33 lines
534 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Default 16 ANSI color names
|
|
color_names=(
|
|
"Black"
|
|
"Red"
|
|
"Green"
|
|
"Yellow"
|
|
"Blue"
|
|
"Magenta"
|
|
"Cyan"
|
|
"White"
|
|
"Bright Black"
|
|
"Bright Red"
|
|
"Bright Green"
|
|
"Bright Yellow"
|
|
"Bright Blue"
|
|
"Bright Magenta"
|
|
"Bright Cyan"
|
|
"Bright White"
|
|
)
|
|
|
|
echo "16-color palette with indices & names:"
|
|
for c in {0..15}; do
|
|
# Print the color block
|
|
printf "\033[38;5;%sm%2d: %-13s\033[0m " "$c" "$c" "${color_names[$c]}"
|
|
# New line every 4 colors
|
|
if (( (c+1) % 4 == 0 )); then
|
|
echo
|
|
fi
|
|
done
|
|
echo
|