zsh-workers
 help / color / mirror / code / Atom feed
* possible PATCH to colors function
@ 2023-07-17 17:44 Jim
  2023-07-17 18:40 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: Jim @ 2023-07-17 17:44 UTC (permalink / raw)
  To: devs

[-- Attachment #1: Type: text/plain, Size: 1566 bytes --]

Hi all,

For the group's consideration.

[bf]g_bold for both <color> and <bright-color> produces  the same result.
  bold with the same "intensity" for both <color> or <bright-color>

I assume this is just the way ansi works.  There is a way of producing two
intensities.
This can be done by adding "faint"(02) to the ansi code to either <color> or
<bright-color>.

If this is something that the group feels could/should be done the following
patch to colors can produce two intensities.

diff --git a/Functions/Misc/colors b/Functions/Misc/colors
index 8a0cec383..fb2548aee 100644
--- a/Functions/Misc/colors
+++ b/Functions/Misc/colors
@@ -120,7 +120,9 @@ bold_color="$lc${color[bold]}$rc"
 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"
+    [[ $k == *bright* ]] \
+      && fg_bold[${k#fg-}]="$lc${color[bold]};${color[$k]}$rc" \
+      ||
fg_bold[${k#fg-}]="$lc${color[faint]};${color[bold]};${color[$k]}$rc"
     fg_no_bold[${k#fg-}]="$lc${color[normal]};${color[$k]}$rc"
 done

@@ -129,6 +131,8 @@ done
 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"
+    [[ $k == *bright* ]] \
+      && bg_bold[${k#bg-}]="$lc${color[bold]};${color[$k]}$rc" \
+      ||
bg_bold[${k#bg-}]="$lc${color[faint]};${color[bold]};${color[$k]}$rc"
     bg_no_bold[${k#bg-}]="$lc${color[normal]};${color[$k]}$rc"
 done

Regards,

Jim Murphy

[-- Attachment #2: Type: text/html, Size: 2120 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-07-18 12:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-17 17:44 possible PATCH to colors function Jim
2023-07-17 18:40 ` Bart Schaefer
2023-07-17 18:48   ` Bart Schaefer
2023-07-18 10:26     ` Jim
2023-07-18 11:18       ` Roman Perepelitsa
2023-07-18 12:48         ` Jim

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).