mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Display All The Terminal Colors as a unix til
This commit is contained in:
23
unix/display-all-the-terminal-colors.md
Normal file
23
unix/display-all-the-terminal-colors.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# Display All The Terminal Colors
|
||||
|
||||
The following snippet of bash scripting will print out a nicely formatted
|
||||
collection of all the terminal colors.
|
||||
|
||||
```bash
|
||||
for x in {0..8}; do
|
||||
for i in {30..37}; do
|
||||
for a in {40..47}; do
|
||||
echo -ne "\e[$x;$i;$a""m\\\e[$x;$i;$a""m\e[0;37;40m "
|
||||
done
|
||||
echo
|
||||
done
|
||||
done
|
||||
echo ""
|
||||
```
|
||||
|
||||
This is a great way to figure out the escape codes you need for coloring and
|
||||
styling text in a bash script.
|
||||
|
||||
[source](https://askubuntu.com/questions/27314/script-to-display-all-terminal-colors)
|
||||
|
||||
h/t Dillon Hafer
|
||||
Reference in New Issue
Block a user