serenity icon indicating copy to clipboard operation
serenity copied to clipboard

Colour schemes: Foreground and background "black" are not the same in the terminal

Open ghost opened this issue 1 year ago • 2 comments

@oskar-skog raises an interesting observation in #24955

The foreground and background "black" colour are not the same.

From their screenshot: image

However, this does not happen in Base16 Dark colour scheme:

image

But it does happen in many other colour schemes, including for example, the default one, as well as Monokai:

image

Is this expected behaviour?

ghost avatar Aug 24 '24 13:08 ghost

In Terminal.app's built-in "Silver Aerogel", the text is visible too:

image

(In most themes, it isn't.)

So I suppose this isn't a reliable way to draw invisible text.

(In Serenity's Terminal, if we were to implement concealing by setting the foreground color to the background color, we'd set the foreground color to the actual background color, and this wouldn't be an issue. But it's a moot point now that we didn't implement it that way.)

nico avatar Aug 24 '24 16:08 nico

Then I have to wonder: Why do so many terminal libraries implement concealed text this way?

It appears to me it wouldn't even be a matter of performance: My implementation completely ignores drawing characters, and should be much faster, and yet we see st and iTerm doing concealed text with colours :thinking:

ghost avatar Aug 24 '24 16:08 ghost