Skip to content

Instantly share code, notes, and snippets.

@ryot4
Last active May 16, 2020 14:46
Show Gist options
  • Save ryot4/589d7c4cf6a55ee56c1b7606e3220a9d to your computer and use it in GitHub Desktop.
Save ryot4/589d7c4cf6a55ee56c1b7606e3220a9d to your computer and use it in GitHub Desktop.
Table of ANSI color escape sequence combinations
#!/bin/sh
for bg in '' $(seq 40 47 | sed 's/^/;/'); do
for bold in '' 1; do
for fg in '' $(seq 30 37 | sed 's/^/;/'); do
code="${bold}${fg}${bg}"
code="${code#;}"
printf '\033[%sm %7s\033[0m' "${code}" "${code}"
done
printf '\n'
done
done
@ryot4
Copy link
Author

ryot4 commented May 16, 2020

Example:

terminal-color-sequence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment