diff options
author | Aaron LI <aaronly.me@gmail.com> | 2016-03-31 10:57:34 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@gmail.com> | 2016-03-31 10:57:34 +0800 |
commit | c9c896dea2ba43551c4e10bd49666105449e9bd7 (patch) | |
tree | e94b73f17b2d776c2acd4c9549657f500c3dc7ce /cli/colortest.lua | |
parent | 2b6cb9b655a53d43b32a8a211287c82f4f59999a (diff) | |
download | atoolbox-c9c896dea2ba43551c4e10bd49666105449e9bd7.tar.bz2 |
add all scripts/tools
Diffstat (limited to 'cli/colortest.lua')
-rwxr-xr-x | cli/colortest.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/cli/colortest.lua b/cli/colortest.lua new file mode 100755 index 0000000..8f8c95f --- /dev/null +++ b/cli/colortest.lua @@ -0,0 +1,22 @@ +#!/usr/bin/env lua + +function cl(e) + return string.format('\27[%sm', e) +end + +function print_fg(bg, pre) + for fg = 30,37 do + fg = pre..fg + io.write(cl(bg), cl(fg), string.format(' %6s ', fg), cl(0)) + end +end + +for bg = 40,47 do + io.write(cl(0), ' ', bg, ' ') + print_fg(bg, ' ') + io.write('\n ') + print_fg(bg, '1;') + io.write('\n\n') +end + +-- Andres P |