lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 23 May 2024 10:05:48 +0200
From: Sirius <sirius@...dheim.com>
To: Gedalya <gedalya@...alya.net>
Cc: netdev@...r.kernel.org
Subject: Re: iproute2: color output should assume dark background

In days of yore (Thu, 23 May 2024), Sirius thus quoth: 
> In days of yore (Thu, 23 May 2024), Gedalya thus quoth: 
> > On 5/23/24 2:39 PM, Sirius wrote:
> > > read what the background is of the console
> > That's COLORFGBG. It is set by some terminal emulators as a way to
> > advertise the colors being used.
> > 
> > I'm no expert but AFAIK there is no uniform way to do this that is
> > supported by all major terminal emulators.
> 
> https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Control-Bytes_-Characters_-and-Sequences
> https://stackoverflow.com/questions/2507337/how-to-determine-a-terminals-background-color
> 
> If you colour the output, then handling the prospect that the background
> might not be the assumed colour kind of comes with the territory.
> Or you deliberately set the background colour to something so that it is
> not undefined. That is what the ANSI colour sequences can do when you use
> strings like \e[32;47m where you deliberately set the background.

https://github.com/dalance/termbg

Someone already did the hard work. Just use that library and you can
detect the background colour or whether a theme is light or dark.

-- 
Kind regards,

/S

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ