Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: possible PATCH to colors function





On Mon, Jul 17, 2023 at 1:48 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Mon, Jul 17, 2023 at 11:40 AM Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> 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



Messages sorted by: Reverse Date, Date, Thread, Author