From 7af712cd9411081f4a5591e1bf06cf6ab6cc9a85 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 2 Apr 2001 12:25:07 +0000 Subject: moved to ./Functions/Misc/colors --- Functions/Misc/colors | 79 --------------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 Functions/Misc/colors (limited to 'Functions/Misc') diff --git a/Functions/Misc/colors b/Functions/Misc/colors deleted file mode 100644 index 6778cbd49..000000000 --- a/Functions/Misc/colors +++ /dev/null @@ -1,79 +0,0 @@ -# Put standard ANSI color codes in shell parameters for easy use. -# Note that some terminals do not support all combinations. - -typeset -Ag color colour - -color=( -# Attribute codes: - 00 none - 01 bold - 02 faint 22 normal - 03 standout 23 no-standout - 04 underline 24 no-underline - 05 blink 25 no-blink - 07 reverse 27 no-reverse - 08 conceal - -# Text color codes: - 30 black 40 bg-black - 31 red 41 bg-red - 32 green 42 bg-green - 33 yellow 43 bg-yellow - 34 blue 44 bg-blue - 35 magenta 45 bg-magenta - 36 cyan 46 bg-cyan - 37 white 47 bg-white - 39 default 49 bg-default -) - -# A word about black and white: The "normal" shade of white is really a -# very pale grey on many terminals; to get truly white text, you have to -# use bold white, and to get a truly white background you have to use -# bold reverse white bg-xxx where xxx is your desired foreground color -# (and which means the foreground is also bold). - -# Map in both directions; could do this with e.g. ${(k)colors[(i)normal]}, -# but it's clearer to include them all both ways. - -local k -for k in ${(k)color}; do color[${color[$k]}]=$k; done - -# Add "fg-" keys for all the text colors, for clarity. - -for k in ${color[(I)3?]}; do color[fg-${color[$k]}]=$k; done - -# This is inaccurate, but the prompt theme system needs it. - -color[grey]=${color[black]} -color[fg-grey]=${color[grey]} -color[bg-grey]=${color[bg-black]} - -# Assistance for the color-blind. - -colour=(${(kv)color}) # A case where ksh namerefs would be useful ... - -# The following are terminal escape sequences used by colored prompt themes. - -local lc=$'\e[' rc=m # Standard ANSI terminal escape values - -typeset -Hg reset_color bold_color -reset_color="$lc${color[none]}$rc" -bold_color="$lc${color[bold]}$rc" - -# Foreground - -typeset -AHg fg fg_bold fg_no_bold -for k in ${(k)color[(I)fg-*]}; do - fg[${k#fg-}]="$lc${color[$k]}$rc" - fg_bold[${k#fg-}]="$lc${color[bold]};${color[$k]}$rc" - fg_no_bold[${k#fg-}]="$lc${color[normal]};${color[$k]}$rc" -done - -# Background - -typeset -AHg bg bg_bold bg_no_bold -for k in ${(k)color[(I)bg-*]}; do - bg[${k#bg-}]="$lc${color[$k]}$rc" - bg_bold[${k#bg-}]="$lc${color[bold]};${color[$k]}$rc" - bg_no_bold[${k#bg-}]="$lc${color[normal]};${color[$k]}$rc" -done -- cgit 1.4.1