zsh-workers
 help / color / mirror / code / Atom feed
From: Jim <linux.tech.guy@gmail.com>
To: devs <zsh-workers@zsh.org>
Subject: possible PATCH to colors function
Date: Mon, 17 Jul 2023 12:44:45 -0500	[thread overview]
Message-ID: <CA+rB6GJb_Vn8yXU8XfQnvACB3c5Fpfp6DtFNGobC42DjcAqpsg@mail.gmail.com> (raw)

[-- 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 --]

             reply	other threads:[~2023-07-17 17:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 17:44 Jim [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+rB6GJb_Vn8yXU8XfQnvACB3c5Fpfp6DtFNGobC42DjcAqpsg@mail.gmail.com \
    --to=linux.tech.guy@gmail.com \
    --cc=linuxtechguy@gmail.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).