zsh-workers
 help / color / mirror / code / Atom feed
From: Jim <linux.tech.guy@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: devs <zsh-workers@zsh.org>
Subject: Re: possible PATCH to colors function
Date: Tue, 18 Jul 2023 05:26:46 -0500	[thread overview]
Message-ID: <CA+rB6GLyX0woKcZT_iCJ0zD6uoh319FJT6Q+cgaWWRZQmpumVA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7ZDht=DiyeUz4DfdvphnXdOrt8Uvwb6w4Eh7WPUByi_ow@mail.gmail.com>

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

On Mon, Jul 17, 2023 at 1:48 PM Bart Schaefer <schaefer@brasslantern.com>
wrote:

> On Mon, Jul 17, 2023 at 11:40 AM Bart Schaefer
> <schaefer@brasslantern.com> wrote:
> >
> > Just for interest, try this:
> > % colors
> > % print -r $'\e['$color[faint]\;${color[bright-red]}m88888${reset_color}\
> > $'\e['${color[red]}m88888${reset_color}\
> > $'\e['${color[bright-red]}m88888${reset_color}
>
> Might be easier to see with :gs/red/yellow
>
> In fact with yellow I can see a difference between "faint yellow" and
> "faint bright-yellow" whereas that's not obvious to me with red.
>
> print -r $'\e['$color[faint]\;${color[yellow]}m#####${reset_color}.\
> $'\e['$color[faint]\;${color[bright-yellow]}m#####${reset_color}.\
> $'\e['${color[yellow]}m#####${reset_color}.\
> $'\e['${color[bright-yellow]}m#####${reset_color}
>

Hopefully I didn't miss something with your answers, or misinterpreted it.

I get the same results with your code.  But the patch has to do with
${color[bold]}.
Without faint the result of bold is the same for <color> and
<bright-color>.  With
faint the result is different intensity.

w/o faint both <color> and <bright-color> produces one intensity
with faint both <color> and <bright-color> produces a different intensity

The following should demonstrate what I'm trying to say.  I added
${color[reverse]}
as I believe it makes it a bit easier to see the difference.

print -r \
$'\e['${color[faint]}\;${color[bright-yellow]}\;${color[reverse]}m${(r.10..
.)}${reset_color}\
$'\e['${color[faint]}\;${color[yellow]}\;${color[reverse]}m${(r.10..
.)}${reset_color}\
$'\e['${color[yellow]}\;${color[reverse]}m${(r.10.. .)}${reset_color}\
$'\e['${color[bright-yellow]}\;${color[reverse]}m${(r.10.. .)}${reset_color}
print -r \
$'\e['${color[bold]}\;${color[faint]}\;${color[bright-yellow]}\;${color[reverse]}m${(r.10..
.)}${reset_color}\
$'\e['${color[bold]}\;${color[faint]}\;${color[yellow]}\;${color[reverse]}m${(r.10..
.)}${reset_color}\
$'\e['${color[bold]}\;${color[yellow]}\;${color[reverse]}m${(r.10..
.)}${reset_color}\
$'\e['${color[bold]}\;${color[bright-yellow]}\;${color[reverse]}m${(r.10..
.)}${reset_color}

I do not have gnome-terminal installed on my system but am using
xfce4-terminal as my
primary terminal.  TERM is set to vte-256color except where I am using tmux
then
TERM is set to tmux-256color

BTW, xfce yellows are very different from one another <color> is a brown,
 where <bright-color> is yellow.

Since gnome and xfce are both based on vte, assuming TERM doesn't cause
issues
I would hope both would produce similar results.  But assuming gets me in
hot water
way too often.

Also tested on:
xterm - TERM=xterm-2556color
uxterm - TERM=xterm-256color

tested on kitty, but kitty seems to not deal with faint very well
only installed kitty for testing

Regards,

Jim

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

  reply	other threads:[~2023-07-18 10:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-17 17:44 Jim
2023-07-17 18:40 ` Bart Schaefer
2023-07-17 18:48   ` Bart Schaefer
2023-07-18 10:26     ` Jim [this message]
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+rB6GLyX0woKcZT_iCJ0zD6uoh319FJT6Q+cgaWWRZQmpumVA@mail.gmail.com \
    --to=linux.tech.guy@gmail.com \
    --cc=linuxtechguy@gmail.com \
    --cc=schaefer@brasslantern.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).