zsh-users
 help / color / mirror / code / Atom feed
* What happens when passing `fg=...,fg=...' to region_highlight, how is this defined?
@ 2018-09-11 13:17 Sebastian Gniazdowski
  2018-09-11 13:27 ` Sebastian Gniazdowski
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2018-09-11 13:17 UTC (permalink / raw)
  To: Zsh Users

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

Hello,
I'm trying to go shortcut in my plugin and in one place just append
`,fg=...' after existing `fg=...', obtaining e.g. `fg=114,fg=55',
hoping the last one will overwrite the first one.

Well, maybe it's too hard stated that I plan to do this, I just
checked if this works and obtained surprising results. Check out
attached file for the results, it is also uploaded to my shell
account: http://psprint.blinkenshell.org/fg-114,fg-55..57.png (the
file is pngcrush-ed, to limit message size).

So it's about the word "$PATH". First line is fg=114,fg=55, then
second line goes fg=114,fg=56, and third goes fg=114,fg=57 in the
region_highlight element. All 3 colors of $PATH differ in the image.
Actual color 114 is PaleGreen3 (color names from:
https://jonasjacek.github.io/colors/), actual 55..57 go from purple to
violet, all in dark brightness.

But the output, i.e. color of word "$PATH" in attached image, goes
from light green to light cyan.

So what's happening? I've tested 2 terminals, iTerm and ExtraTerm.
Also tried other combinations of colors, the results were similar, but
here I just focused on the three 55..57. I write because I sense some
possible feature heh? Some mixing of colors? Or some bug in a more
serious situation than this `double-fg=' case.

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

[-- Attachment #2: fg-114,fg-55..57.png --]
[-- Type: image/png, Size: 11216 bytes --]

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

* Re: What happens when passing `fg=...,fg=...' to region_highlight, how is this defined?
  2018-09-11 13:17 What happens when passing `fg=...,fg=...' to region_highlight, how is this defined? Sebastian Gniazdowski
@ 2018-09-11 13:27 ` Sebastian Gniazdowski
  2018-09-11 13:39   ` Peter Stephenson
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Gniazdowski @ 2018-09-11 13:27 UTC (permalink / raw)
  To: Zsh Users

Just thought that maybe Zsh just sums up the color indices :)
Immediate confirmation is not there, 169...171 (114+55, etc.) goes
from reddish to a purple.

However looking little up, there is 157, 158, 159 that apparently
matches the colors of $PATH in the attached image.

I use this to see the palette:
 ▲ ~ which palette
palette () {
    for n in {000..255}
    do
        colors+=("%F{$n}$n%f")
    done
    print -cP $colors
}
On Tue, 11 Sep 2018 at 15:17, Sebastian Gniazdowski
<sgniazdowski@gmail.com> wrote:
>
> Hello,
> I'm trying to go shortcut in my plugin and in one place just append
> `,fg=...' after existing `fg=...', obtaining e.g. `fg=114,fg=55',
> hoping the last one will overwrite the first one.
>
> Well, maybe it's too hard stated that I plan to do this, I just
> checked if this works and obtained surprising results. Check out
> attached file for the results, it is also uploaded to my shell
> account: http://psprint.blinkenshell.org/fg-114,fg-55..57.png (the
> file is pngcrush-ed, to limit message size).
>
> So it's about the word "$PATH". First line is fg=114,fg=55, then
> second line goes fg=114,fg=56, and third goes fg=114,fg=57 in the
> region_highlight element. All 3 colors of $PATH differ in the image.
> Actual color 114 is PaleGreen3 (color names from:
> https://jonasjacek.github.io/colors/), actual 55..57 go from purple to
> violet, all in dark brightness.
>
> But the output, i.e. color of word "$PATH" in attached image, goes
> from light green to light cyan.
>
> So what's happening? I've tested 2 terminals, iTerm and ExtraTerm.
> Also tried other combinations of colors, the results were similar, but
> here I just focused on the three 55..57. I write because I sense some
> possible feature heh? Some mixing of colors? Or some bug in a more
> serious situation than this `double-fg=' case.
>
> --
> Sebastian Gniazdowski
> News: https://twitter.com/ZdharmaI
> IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
> Blog: http://zdharma.org



-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin
Blog: http://zdharma.org

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

* Re: What happens when passing `fg=...,fg=...' to region_highlight, how is this defined?
  2018-09-11 13:27 ` Sebastian Gniazdowski
@ 2018-09-11 13:39   ` Peter Stephenson
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Stephenson @ 2018-09-11 13:39 UTC (permalink / raw)
  To: Sebastian Gniazdowski; +Cc: Zsh Users

On Tue, 11 Sep 2018 15:27:20 +0200
Sebastian Gniazdowski <sgniazdowski@gmail.com> wrote:
> Just thought that maybe Zsh just sums up the color indices :)
> Immediate confirmation is not there, 169...171 (114+55, etc.) goes
> from reddish to a purple.

Everything is output as control codes and there is no amalgamation.

You should be able to debug this by logging at a low enough level what is
being sent to the terminal.  I would think "script" should do this.

pws

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

end of thread, other threads:[~2018-09-11 13:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-11 13:17 What happens when passing `fg=...,fg=...' to region_highlight, how is this defined? Sebastian Gniazdowski
2018-09-11 13:27 ` Sebastian Gniazdowski
2018-09-11 13:39   ` Peter Stephenson

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).