Subject: Re: bug#71213: [PATCH] Use the current face foreground for read-passwd icons

From: Kévin Le Gouguec <[email-masked]>
Date: Mon, 27 May 2024 20:11:02 +0200

Michael Albinus via "Bug reports for GNU Emacs, the Swiss army knife of
text editors" <[email-masked]> writes:

>> We've done something similar for other icons, e.g. in 2021-11-02 "Use
>> current face foreground for SVG icons in customize" (11702a6dd7c).  I
>> think it makes sense for these too, since "#2e3436" (and any shade of
>> not-strictly-gray-but-close-enough) is liable to have low contrast with
>> the mode line background depending on the theme (e.g. modus-vivendi).
>>
>> Let me know what you think.
>
> I have absolutely no knowledge about image formats. I've stolen the two
> files from the Gnome repository, that's it. So I won't object any
> change.

Right, AFAIU we followed the same approach for the icons I mention above
(grabbed the icons somewhere, realized their foreground fared poorly
depending on the background, stripped their 'fill' attribute).

> While we're at it: do the two correspinding *.pbm files also need some
> care?

It's not a format I am familiar with, but empirically,

  (insert-image (create-image "conceal.pbm"))

inserts an icon that automagically changes color as I switch between
light and dark themes.  pbm(5) says the format is monochrome, and (info
"(elisp) Other Image Types") confirms Emacs does the obvious thing by
default (frame foreground for one bits; frame background for zero bits).

>       And do we need to create also *.xbm files?

Not sure if we have a policy or guidelines there; etc/images/README
explains how to convert from xpm > xbm > pbm, but does not provide
judgments on which are needed.  (info "(elisp) Image Formats") says

       Supported image formats (and the required support libraries) include
    PBM and XBM (which do not depend on support libraries and are always
    available),

which makes me tempted to say "if we have lowest-common-denominator
formats like PBM or XBM for our icons, then we're good, the rest is
bonus"?