mirror of
https://github.com/jimeh/git-aware-prompt.git
synced 2026-02-19 13:36:38 +00:00
Use tput to generate color codes
This allows "echo", among other commands, to use these sequences under OS X
This commit is contained in:
67
colors.sh
67
colors.sh
@@ -1,40 +1,41 @@
|
|||||||
# Regular
|
# Regular
|
||||||
txtblk='\e[0;30m' # Black
|
txtblk="$(tput setaf 0)" # Black
|
||||||
txtred='\e[0;31m' # Red
|
txtred="$(tput setaf 1)" # Red
|
||||||
txtgrn='\e[0;32m' # Green
|
txtgrn="$(tput setaf 2)" # Green
|
||||||
txtylw='\e[0;33m' # Yellow
|
txtylw="$(tput setaf 3)" # Yellow
|
||||||
txtblu='\e[0;34m' # Blue
|
txtblu="$(tput setaf 4)" # Blue
|
||||||
txtpur='\e[0;35m' # Purple
|
txtpur="$(tput setaf 5)" # Purple
|
||||||
txtcyn='\e[0;36m' # Cyan
|
txtcyn="$(tput setaf 6)" # Cyan
|
||||||
txtwht='\e[0;37m' # White
|
txtwht="$(tput setaf 7)" # White
|
||||||
|
|
||||||
# Bold
|
# Bold
|
||||||
bldblk='\e[1;30m' # Black
|
bldblk="$(tput setaf 0)$(tput bold)" # Black
|
||||||
bldred='\e[1;31m' # Red
|
bldred="$(tput setaf 1)$(tput bold)" # Red
|
||||||
bldgrn='\e[1;32m' # Green
|
bldgrn="$(tput setaf 2)$(tput bold)" # Green
|
||||||
bldylw='\e[1;33m' # Yellow
|
bldylw="$(tput setaf 3)$(tput bold)" # Yellow
|
||||||
bldblu='\e[1;34m' # Blue
|
bldblu="$(tput setaf 4)$(tput bold)" # Blue
|
||||||
bldpur='\e[1;35m' # Purple
|
bldpur="$(tput setaf 5)$(tput bold)" # Purple
|
||||||
bldcyn='\e[1;36m' # Cyan
|
bldcyn="$(tput setaf 6)$(tput bold)" # Cyan
|
||||||
bldwht='\e[1;37m' # White
|
bldwht="$(tput setaf 7)$(tput bold)" # White
|
||||||
|
|
||||||
# Underline
|
# Underline
|
||||||
undblk='\e[4;30m' # Black
|
undblk="$(tput setaf 0)$(tput smul)" # Black
|
||||||
undred='\e[4;31m' # Red
|
undred="$(tput setaf 1)$(tput smul)" # Red
|
||||||
undgrn='\e[4;32m' # Green
|
undgrn="$(tput setaf 2)$(tput smul)" # Green
|
||||||
undylw='\e[4;33m' # Yellow
|
undylw="$(tput setaf 3)$(tput smul)" # Yellow
|
||||||
undblu='\e[4;34m' # Blue
|
undblu="$(tput setaf 4)$(tput smul)" # Blue
|
||||||
undpur='\e[4;35m' # Purple
|
undpur="$(tput setaf 5)$(tput smul)" # Purple
|
||||||
undcyn='\e[4;36m' # Cyan
|
undcyn="$(tput setaf 6)$(tput smul)" # Cyan
|
||||||
undwht='\e[4;37m' # White
|
undwht="$(tput setaf 7)$(tput smul)" # White
|
||||||
|
|
||||||
# Background
|
# Background
|
||||||
bakblk='\e[40m' # Black
|
bakblk="$(tput setab 0)" # Black
|
||||||
bakred='\e[41m' # Red
|
bakred="$(tput setab 1)" # Red
|
||||||
bakgrn='\e[42m' # Green
|
bakgrn="$(tput setab 2)" # Green
|
||||||
bakylw='\e[43m' # Yellow
|
bakylw="$(tput setab 3)" # Yellow
|
||||||
bakblu='\e[44m' # Blue
|
bakblu="$(tput setab 4)" # Blue
|
||||||
bakpur='\e[45m' # Purple
|
bakpur="$(tput setab 5)" # Purple
|
||||||
bakcyn='\e[46m' # Cyan
|
bakcyn="$(tput setab 6)" # Cyan
|
||||||
bakwht='\e[47m' # White
|
bakwht="$(tput setab 7)" # White
|
||||||
txtrst='\e[0m' # Text Reset
|
|
||||||
|
txtrst="$(tput sgr 0)" # Text Reset
|
||||||
|
|||||||
Reference in New Issue
Block a user