aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2022-05-14 20:34:28 -0700
committerBart Schaefer <schaefer@zsh.org>2022-05-14 20:34:28 -0700
commit84dde7c7b622737a34526ac2a5ba29ddc6c072d8 (patch)
treeab03f225c98205dfb3f7adc2ac8f8b91d0b1a036
parent361de369edd3bd17066b5f72e056e487545b364e (diff)
downloadzsh-84dde7c7b622737a34526ac2a5ba29ddc6c072d8.tar.gz
zsh-84dde7c7b622737a34526ac2a5ba29ddc6c072d8.tar.xz
zsh-84dde7c7b622737a34526ac2a5ba29ddc6c072d8.zip
Jan Brieg: 50212 (and discussion): Add "bright" color variants
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Misc/colors18
2 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b5e85e180..a63f820a8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-05-14 Bart Schaefer <schaefer@zsh.org>
+
+ * Jan Brieg: 50212 (and discussion): Functions/Misc/colors: Add
+ "bright" color variants
+
2022-05-15 Axel Beckert <abe@deuxchevaux.org>
* 50220: Doc/Zsh/{builtins,options}.yo: Fix typos found by
diff --git a/Functions/Misc/colors b/Functions/Misc/colors
index 5e9d77d10..5c9924adb 100644
--- a/Functions/Misc/colors
+++ b/Functions/Misc/colors
@@ -63,6 +63,16 @@ color=(
# 63 double-overline-or-left
# 64 stress
# 65 no-ideogram-marking
+
+# Bright color codes (xterm extension)
+ 90 bright-gray 100 bg-bright-gray
+ 91 bright-red 101 bg-bright-red
+ 92 bright-green 102 bg-bright-green
+ 93 bright-yellow 103 bg-bright-yellow
+ 94 bright-blue 104 bg-bright-blue
+ 95 bright-magenta 105 bg-bright-magenta
+ 96 bright-cyan 106 bg-bright-cyan
+ 97 bright-white 107 bg-bright-white
)
# A word about black and white: The "normal" shade of white is really a
@@ -79,7 +89,7 @@ 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
+for k in ${color[(I)[39]?]}; do color[fg-${color[$k]}]=$k; done
# This is inaccurate, but the prompt theme system needs it.
@@ -89,7 +99,11 @@ for k in grey gray; do
color[bg-$k]=${color[bg-black]}
done
-# Assistance for the color-blind.
+# Assistance for the colo(u)r-blind.
+
+for k in '' fg- bg-; do
+ color[${k}bright-grey]=${color[${k}bright-gray]}
+done
colour=(${(kv)color}) # A case where ksh namerefs would be useful ...