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
| From: http://misc.flogisoft.com/bash/tip_colors_and_formatting | |
| This is working for me for now (it's only lightly tested, fails gracefully if the numbers are too high, fails ungracefully if you give too few arguments, and uses features in bash new to me (hey, been away for awhile), so not sure if they are standard or new... with that out of the way: | |
| Now I can do things like echo "$(c_grey 15)I'm light Grey$(c_clr)" and | |
| echo "$(cb_rgb 5 0 0)Red$(cb_rgb 0 5 0)Green$(cb_rgb 0 0 5)Blue$(c_clr)" | |
| At any rate, hope this helps someone. |
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
| #! /usr/bin/env bash | |
| # print all the xterm colors | |
| # see http://serverfault.com/a/91873 about caculating the rgb values | |
| for c in {0..15} | |
| do | |
| printf "\033[38;5;%dm %2d" $c $c | |
| if (( (c+1) % 8 == 0 )) ; then |
NewerOlder