-
-
Save bjarneo/0712fca4b62bb08d83dc2c26da2e543b to your computer and use it in GitHub Desktop.
ansi.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -euo pipefail | |
| # This script displays the 16 standard ANSI colors (0-15) as large squares | |
| # in two rows: first row shows colors 0-7, second row shows colors 8-15 | |
| echo "" | |
| # First row: ANSI colors 0-7 (dark colors) | |
| for row in {1..4}; do | |
| for color in {0..7}; do | |
| printf "\e[38;5;${color}m\e[48;5;${color}m████████\e[0m " | |
| done | |
| echo "" | |
| done | |
| echo "" | |
| # Second row: ANSI colors 8-15 (bright colors) | |
| for row in {1..4}; do | |
| for color in {8..15}; do | |
| printf "\e[38;5;${color}m\e[48;5;${color}m████████\e[0m " | |
| done | |
| echo "" | |
| done | |
| echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment